From: Vadim Zeitlin Date: Sun, 24 Jul 2011 22:19:37 +0000 (+0000) Subject: Exclude windows not accepting keyboard focus from GTK focus chain. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a3edb930b96c3d8af31e8f57faa072dd61dd200c?hp=-c Exclude windows not accepting keyboard focus from GTK focus chain. For some reason the test for AcceptsFocusFromKeyboard() wasn't done in the correct place when constructing the GTK focus chain and even windows returning false from it were still added to it. Do not do this any more, this prevents the windows which are really not meant to be focusable from keyboard (such as the pseudo-buttons in the generic implementation of wxSearchCtrl) from gaining focus unexpectedly. See #12808. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- a3edb930b96c3d8af31e8f57faa072dd61dd200c diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index e7da36cf07..82a20f8a58 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3443,9 +3443,11 @@ void wxWindowGTK::RealizeTabOrder() { wxWindowGTK *win = *i; + bool focusableFromKeyboard = win->AcceptsFocusFromKeyboard(); + if ( mnemonicWindow ) { - if ( win->AcceptsFocusFromKeyboard() ) + if ( focusableFromKeyboard ) { // wxComboBox et al. needs to focus on on a different // widget than m_widget, so if the main widget isn't @@ -3470,7 +3472,8 @@ void wxWindowGTK::RealizeTabOrder() mnemonicWindow = win; } - chain = g_list_prepend(chain, win->m_widget); + if ( focusableFromKeyboard ) + chain = g_list_prepend(chain, win->m_widget); } chain = g_list_reverse(chain);