From e3bd895667a1dbecaae50a0e2911ed1319111f79 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 17 Sep 2015 23:22:39 +0200 Subject: [PATCH] window: Reset on unhandled gestures right away Traditionally a sequence is set to GTK_EVENT_SEQUENCE_DENIED state when it is to be ignored, which means it is dormant, but still managed by the gesture (accounting, "denied" sequences still make "slots" in multitouch gesture busy, etc...). This gesture will run for all button presses and releases in the window though when presses happen on the "window content" region, and we can't account for every children to be as educated as setting the proper mask on every window, or ensuring events will be propagated as they should. In order to cater for this, just reset the gestures, we can live without such accounting in these specific GtkGestureSingle gestures. https://bugzilla.gnome.org/show_bug.cgi?id=754098 --- gtk/gtkwindow.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 7cb2497ac5..bf6d510faf 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -61,6 +61,7 @@ #include "a11y/gtkwindowaccessible.h" #include "a11y/gtkcontaineraccessibleprivate.h" #include "gtkapplicationprivate.h" +#include "gtkgestureprivate.h" #include "inspector/init.h" #include "inspector/window.h" @@ -1450,6 +1451,14 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, { gtk_gesture_set_sequence_state (GTK_GESTURE (gesture), sequence, GTK_EVENT_SEQUENCE_DENIED); + + /* Reset immediately the gestures, here we don't get many guarantees + * about whether the target window event mask will be complete enough + * to keep gestures consistent, or whether any widget across the + * hierarchy will be inconsistent about event handler return values. + */ + gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture)); + gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->drag_gesture)); return; } /* fall thru */