Use IsTopNavigationDomain() in accelerator handling code in all ports

This is more correct than IsTopLevel() as accelerators shouldn't traverse the
"navigation domain" boundaries, by definition, and, even more importantly in
practice, some TLWs shouldn't stop the accelerators propagation, see the next
commit.

See #16870.
This commit is contained in:
Kinaou Herve 2016-01-30 18:35:32 +01:00 committed by Vadim Zeitlin
parent 11f6ecce6b
commit 8034e35391
3 changed files with 4 additions and 4 deletions

View File

@ -1105,7 +1105,7 @@ gtk_window_key_press_callback( GtkWidget *WXUNUSED(widget),
break;
}
if (ancestor->IsTopLevel())
if (ancestor->IsTopNavigationDomain())
break;
ancestor = ancestor->GetParent();
}

View File

@ -137,7 +137,7 @@ bool wxGUIEventLoop::PreProcessMessage(WXMSG *msg)
// stop at first top level window, i.e. don't try to process the key
// strokes originating in a dialog using the accelerators of the parent
// frame - this doesn't make much sense
if ( wnd->IsTopLevel() )
if ( wnd->IsTopNavigationDomain() )
break;
}
@ -151,7 +151,7 @@ bool wxGUIEventLoop::PreProcessMessage(WXMSG *msg)
// if we don't do this, pressing ESC on a modal dialog shown as child
// of a modal dialog with wxID_CANCEL will cause the parent dialog to
// be closed, for example
if ( wnd->IsTopLevel() )
if ( wnd->IsTopNavigationDomain() )
break;
}

View File

@ -2761,7 +2761,7 @@ bool wxWindowMac::OSXHandleKeyEvent( wxKeyEvent& event )
break;
}
if (ancestor->IsTopLevel())
if (ancestor->IsTopNavigationDomain())
break;
ancestor = ancestor->GetParent();