From 8034e35391db1f77842a053d2889331d35d3e17f Mon Sep 17 00:00:00 2001 From: Kinaou Herve Date: Sat, 30 Jan 2016 18:35:32 +0100 Subject: [PATCH] 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. --- src/gtk/window.cpp | 2 +- src/msw/evtloop.cpp | 4 ++-- src/osx/window_osx.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index e85cc90c77..9ace53a97c 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1105,7 +1105,7 @@ gtk_window_key_press_callback( GtkWidget *WXUNUSED(widget), break; } - if (ancestor->IsTopLevel()) + if (ancestor->IsTopNavigationDomain()) break; ancestor = ancestor->GetParent(); } diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp index 1d5ccc7737..cb2bae0d5f 100644 --- a/src/msw/evtloop.cpp +++ b/src/msw/evtloop.cpp @@ -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; } diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 67a96cce70..4e027720e7 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -2761,7 +2761,7 @@ bool wxWindowMac::OSXHandleKeyEvent( wxKeyEvent& event ) break; } - if (ancestor->IsTopLevel()) + if (ancestor->IsTopNavigationDomain()) break; ancestor = ancestor->GetParent();