From ae499c43f1fdcc53c812c8d4eb781f04498ae2e8 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 215c3ad625..a24ff517e2 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1692,7 +1692,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(); }