Fix checking for the deepest shown window in focus handling code
wxSetFocusToChild() could recurse to the parent TLW, which was clearly nonsensical as it means that restoring last focus in a dialog could end up setting it to the parent frame. Fix this by breaking out of the loop as soon as we reach a TLW. See #18653.
This commit is contained in:
@@ -711,6 +711,9 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
|
||||
else
|
||||
deepestVisibleWindow = NULL;
|
||||
|
||||
if ( (*childLastFocused)->IsTopLevel() )
|
||||
break;
|
||||
|
||||
*childLastFocused = (*childLastFocused)->GetParent();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user