[nautilus/wip/cdavis/use-status-page: 1/4] list-base: Move bg click gestures to view




commit cf47a8e2d12070b12e7093cd1c54cb505faa3d29
Author: António Fernandes <antoniof gnome org>
Date:   Sat Jul 16 17:14:53 2022 +0100

    list-base: Move bg click gestures to view
    
    We've been setting background click gestures on the view_ui widget,
    which is either GtkGridView or GtkColumnView.
    
    But this means the empty state widgets don't get to handle these
    clicks. And the situation would get worse with AdwStatusPage, which
    fills the whole area.
    
    So, follow the lead of the background drop target and set the gestures
    on the NautilusFilesView container itself. This has the side effect
    of clicks on the floating status bar working like clicks on the empty
    space. But it's not a big problem.

 src/nautilus-list-base.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index a28468dfa..49751c8c6 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -1714,18 +1714,17 @@ void
 nautilus_list_base_setup_gestures (NautilusListBase *self)
 {
     NautilusListBasePrivate *priv = nautilus_list_base_get_instance_private (self);
-    GtkWidget *view_ui = nautilus_list_base_get_view_ui (self);
     GtkEventController *controller;
     GtkDropTarget *drop_target;
 
     controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ());
-    gtk_widget_add_controller (view_ui, controller);
+    gtk_widget_add_controller (GTK_WIDGET (self), controller);
     gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (controller), 0);
     g_signal_connect (controller, "pressed",
                       G_CALLBACK (on_view_click_pressed), self);
 
     controller = GTK_EVENT_CONTROLLER (gtk_gesture_long_press_new ());
-    gtk_widget_add_controller (view_ui, controller);
+    gtk_widget_add_controller (GTK_WIDGET (self), controller);
     gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (controller), TRUE);
     g_signal_connect (controller, "pressed",
                       G_CALLBACK (on_view_longpress_pressed), self);


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