Improve the check for TLW in focus handling code

Use IsTopNavigationDomain() instead of IsTopLevel() to do the right
thing for MDI child frames too.
This commit is contained in:
Vadim Zeitlin
2020-01-20 12:42:18 +01:00
parent 50a6e80be5
commit 724621929d

View File

@@ -711,8 +711,15 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
else
deepestVisibleWindow = NULL;
if ( (*childLastFocused)->IsTopLevel() )
// We shouldn't be looking for the child to focus beyond the
// TLW boundary. And we use IsTopNavigationDomain() here
// instead of IsTopLevel() because wxMDIChildFrame is also TLW
// from this point of view.
if ( (*childLastFocused)->
IsTopNavigationDomain(wxWindow::Navigation_Tab) )
{
break;
}
*childLastFocused = (*childLastFocused)->GetParent();
}