diff --git a/docs/changes.txt b/docs/changes.txt index af95c7bb2f..9a7e08d7e1 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -574,6 +574,7 @@ wxGTK: - Provide native implementation of wxNotificationMessage using libnotify. - Generate clipboard events for wxComboBox and not only wxTextCtrl. - Improve drag-and-drop of URLs. +- Make key event handling consistent with wxMSW (John Rails). wxMSW: diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index b561d5f61d..99119fa896 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -640,6 +640,14 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, g_signal_connect_after (m_widget, "focus_out_event", G_CALLBACK (gtk_frame_focus_out_callback), this); + // GTK processes key events at the top level first, which handles for + // menu accelerators and shortcuts before passing the event on to the + // focus child window to begin propagation. We want to propagate + // first, so we connect gtk_window_propagate_key_event to + // key_press_event. + g_signal_connect (m_widget, "key_press_event", + G_CALLBACK (gtk_window_propagate_key_event), NULL); + #ifdef GDK_WINDOWING_X11 #ifdef __WXGTK3__ if (GDK_IS_X11_SCREEN(gtk_window_get_screen(GTK_WINDOW(m_widget))))