X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..3cd2f0bdee7cfaac783455aa25cb617b9d601f17:/src/common/containr.cpp?ds=sidebyside diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 6df39ca62c..f9595d1f0a 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -6,7 +6,7 @@ // Created: 06.08.01 // RCS-ID: $Id$ // Copyright: (c) 2001 Vadim Zeitlin -// License: wxWidgets licence +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -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();