From 85dbf5f732a2de4c969d8b18b0549b56d8a5c66a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 15 Apr 2020 16:02:43 +0200 Subject: [PATCH] Don't set focus to unfocusable windows in wxGTK Restore IsFocusable() check that was commented out, without any real explanation, by c7bfb76a2c (A number of focus handling improvements: Left clicking on a window only focuses the window if not processed. wxControlContainer::SetFocus moved to wxControlContainerBase so that a container now focuses the first child even on wxGTK. wxAuiBook is now a container, need for correct navigation on wxGTK., 2007-08-18). This is needed to avoid giving focus on click to the windows that explicitly override AcceptsFocus() to return false, as e.g. wxGridColLabelWindow and other wxGrid subwindow classes do. From the user point of view, previously clicking on a grid row/column label just disabled the user of arrow keys, which was very inconvenient (and didn't happen under MSW). --- src/gtk/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 14bbcf1d55..16cbf06f6e 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1691,7 +1691,7 @@ gtk_window_button_press_callback( GtkWidget* WXUNUSED_IN_GTK3(widget), return TRUE; if ((event_type == wxEVT_LEFT_DOWN) && !win->IsOfStandardClass() && - (gs_currentFocus != win) /* && win->IsFocusable() */) + (gs_currentFocus != win) && win->IsFocusable()) { win->SetFocus(); }