From 96430b3f3d40c483f49ae419babf6c2e5255ac0a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Mar 2014 14:03:33 +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/branches/WX_3_0_BRANCH@76100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/gtk/window.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 7cdd7926a1..2d1e008219 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -613,6 +613,7 @@ wxGTK: - Fix AUI panel re-docking. - Add support for wxDD_DIR_MUST_EXIST to wxDirDialog. - Fix disappearing mouse clicks when using wxTreeCtrl. +- Fix calls to Move{Before,After}InTabOrder() after parent window creation. wxMSW: diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index bce406a4a2..e71ca1db8d 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3549,8 +3549,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)