X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b33f7651ae55310d7d76b0205e409464ba8af484..418b7d6ba53249b31499fefd4e46bb752a0cd045:/src/common/containr.cpp diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 69b8fa56ae..f9595d1f0a 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -344,9 +344,7 @@ bool wxControlContainer::DoSetFocus() if (m_inSetFocus) return true; - - m_inSetFocus = true; - + // when the panel gets the focus we move the focus to either the last // window that had the focus or the first one that can get it unless the // focus had been already set to some other child @@ -357,7 +355,7 @@ bool wxControlContainer::DoSetFocus() if ( win == m_winParent ) { // our child already has focus, don't take it away from it - return TRUE; + return true; } if ( win->IsTopLevel() ) @@ -369,6 +367,9 @@ bool wxControlContainer::DoSetFocus() win = win->GetParent(); } + + // protect against infinite recursion: + m_inSetFocus = true; bool ret = SetFocusToChild();