From 6f5b629f2f55e57ca8b9412052cbd02d4609512b Mon Sep 17 00:00:00 2001 From: Tim Kosse Date: Thu, 14 Jan 2016 15:26:49 +0100 Subject: [PATCH] Don't assert if Ctrl+Tab is pressed inside a wxGTK window Ignore the WinChange flag in DoNavigateIn() to fix an assertion that happened when pressing Ctrl+Tab with the generic wxListCtrl having focus. This seems to be consistent with pressing Ctrl+Tab elsewhere, e.g. when cycling between buttons in a dialog. (this is a backport of f3cd79984f2936a4148964af8c23cd42aab6a871 from master) --- src/gtk/window.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index ed62efe7a1..a1619c5d0e 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3713,26 +3713,17 @@ void wxWindowGTK::DoMoveInTabOrder(wxWindow *win, WindowOrder move) bool wxWindowGTK::DoNavigateIn(int flags) { - if ( flags & wxNavigationKeyEvent::WinChange ) - { - wxFAIL_MSG( wxT("not implemented") ); + wxWindow *parent = wxGetTopLevelParent((wxWindow *)this); + wxCHECK_MSG( parent, false, wxT("every window must have a TLW parent") ); - return false; - } - else // navigate inside the container - { - wxWindow *parent = wxGetTopLevelParent((wxWindow *)this); - wxCHECK_MSG( parent, false, wxT("every window must have a TLW parent") ); + GtkDirectionType dir; + dir = flags & wxNavigationKeyEvent::IsForward ? GTK_DIR_TAB_FORWARD + : GTK_DIR_TAB_BACKWARD; - GtkDirectionType dir; - dir = flags & wxNavigationKeyEvent::IsForward ? GTK_DIR_TAB_FORWARD - : GTK_DIR_TAB_BACKWARD; + gboolean rc; + g_signal_emit_by_name(parent->m_widget, "focus", dir, &rc); - gboolean rc; - g_signal_emit_by_name(parent->m_widget, "focus", dir, &rc); - - return rc != 0; - } + return rc != 0; } bool wxWindowGTK::GTKWidgetNeedsMnemonic() const