From 09a8d39b6370bef265d67f4e26ff2c79e10184a1 Mon Sep 17 00:00:00 2001 From: Corey Berla Date: Fri, 7 Oct 2022 21:02:48 -0700 Subject: 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. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2616 --- 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", -- cgit v1.2.1