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




commit 5d24771d67dae22a0b2490510a46f3a9553bbb73
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 if the view is specifically clicked.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2433

 src/nautilus-list-base.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index 2827220e1..54ac19473 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -438,6 +438,10 @@ on_view_click_pressed (GtkGestureClick *gesture,
         return;
     }
 
+    /* We are overriding many of the gestures for the views so let's make sure to
+     * grab the focus in order to make rubberbanding and background click work */
+    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]