From 2b5574c6ea386502a930a5a2c4f2d0a0e5d2e4af Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Mar 2014 14:05:02 +0000 Subject: [PATCH] Make Move{Before,After}InTabOrder() work at any time in wxGTK. These functions only worked if called at the beginning, before showing the parent window containing the children whose TAB order was being adjusted, because it didn't refresh the GTK+ TAB order on the correct window: we need to do it for the parent of the window being moved, not this window itself. Closes #16032. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index d704d6478f..f9beeba98a 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3541,8 +3541,15 @@ wxWindowGTK::AdjustForLayoutDirection(wxCoord x, void wxWindowGTK::DoMoveInTabOrder(wxWindow *win, WindowOrder move) { wxWindowBase::DoMoveInTabOrder(win, move); - m_dirtyTabOrder = true; - wxTheApp->WakeUpIdle(); + + // Update the TAB order at GTK+ level too, but do it slightly later in case + // we're changing the TAB order of several controls at once, as is common. + wxWindow* const parent = GetParent(); + if ( parent ) + { + parent->m_dirtyTabOrder = true; + wxTheApp->WakeUpIdle(); + } } bool wxWindowGTK::DoNavigateIn(int flags)