summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-10-07 21:02:48 -0700
committerCorey Berla <corey@berla.me>2022-11-17 21:18:35 -0800
commit09a8d39b6370bef265d67f4e26ff2c79e10184a1 (patch)
tree466a43f0b77294407158617b4277394aa4c94f82
parentf7b06ed6b512993fd2b63c07534a1faf477efd2e (diff)
downloadnautilus-wip/corey/gesture-fix.tar.gz
list-base: Set view longpress to GTK_PHASE_CAPTUREwip/corey/gesture-fix
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. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2616
-rw-r--r--src/nautilus-list-base.c1
1 files changed, 1 insertions, 0 deletions
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",