[nautilus/wip/corey/list-view: 1/3] list-base: Grab focus when background of the view clicked




commit 99a03d656f5fde4992a4ee81eae5ea290f62f470
Author: Corey Berla <corey berla me>
Date:   Sun Aug 21 14:11:40 2022 -0700

    list-base: Grab focus when background of the view clicked
    
    We are overriding how the grid / column view selection is handled
    which appears to be affecting focus.  When the view is selected,
    or rubberbanded, the view doesn't grab the focus which breaks keyboard
    shortcuts.  Grab focus is the view is specifically clicked.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2433

 src/nautilus-list-base.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index 2827220e1..83f671e79 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -438,6 +438,8 @@ on_view_click_pressed (GtkGestureClick *gesture,
         return;
     }
 
+    gtk_widget_grab_focus (GTK_WIDGET (self));
+
     /* Don't interfere with GtkListBase default selection handling when
      * holding Ctrl and Shift. */
     modifiers = gtk_event_controller_get_current_event_state (GTK_EVENT_CONTROLLER (gesture));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]