diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 196ada8172..110cbd2687 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -711,6 +711,9 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) else deepestVisibleWindow = NULL; + if ( (*childLastFocused)->IsTopLevel() ) + break; + *childLastFocused = (*childLastFocused)->GetParent(); }