[nautilus/wip/corey/gesture-fix] list-base: Set view longpress to GTK_PHASE_CAPTURE




commit 56b6eca9d5e15b1e3e565e1432677b420a711d95
Author: Corey Berla <corey berla me>
Date:   Fri Oct 7 21:02:48 2022 -0700

    list-base: Set view longpress to GTK_PHASE_CAPTURE
    
    There's an issue with how GtkGestureLongPress functions where if the
    gesture is in phase BUBBLE and another gesture in CAPTURE claims
    the sequence, the prior LongPress will emit a ::pressed event
    regardless.  More specifically, our code doesn't work because the
    drag gesture in GtkListBase (which tracks if rubberband should be
    stopped) prevent events from being sent to our view long press gesture.
    This makes the background menu pop-up unexpectedly while dragging
    on a touchscreen.

 src/nautilus-list-base.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index c1f85e6d1..ad084d5c3 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -1814,6 +1814,7 @@ nautilus_list_base_setup_gestures (NautilusListBase *self)
                       G_CALLBACK (on_view_click_pressed), self);
 
     controller = GTK_EVENT_CONTROLLER (gtk_gesture_long_press_new ());
+    gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
     gtk_widget_add_controller (GTK_WIDGET (self), controller);
     gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (controller), TRUE);
     g_signal_connect (controller, "pressed",


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