summaryrefslogtreecommitdiff
path: root/gtk/gtkgesture.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-05-24 18:22:00 +0200
committerCarlos Garnacho <carlosg@gnome.org>2017-05-25 16:25:59 +0200
commitf8bc56dd553aebce376ba0eab6e296e19762b781 (patch)
tree9a4005a0666f6e7772b67f855d67cdd997c8c833 /gtk/gtkgesture.c
parent8371b6b8576830a51a350a09cf12c601c99c8027 (diff)
downloadgtk+-f8bc56dd553aebce376ba0eab6e296e19762b781.tar.gz
gtkgesture: Consume button release/touch end events if gesture was claimed
In these situations we must perform the "is it claimed" check before removing the (touch)point, as doing so when the gesture is empty will be too late if the gesture actually claimed input.
Diffstat (limited to 'gtk/gtkgesture.c')
-rw-r--r--gtk/gtkgesture.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index caef7d4612..d8885ea2eb 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -693,6 +693,11 @@ gtk_gesture_handle_event (GtkEventController *controller,
(event->type == GDK_TOUCHPAD_PINCH &&
event->touchpad_pinch.phase == GDK_TOUCHPAD_GESTURE_PHASE_END))
{
+ gboolean was_claimed;
+
+ was_claimed =
+ gtk_gesture_get_sequence_state (gesture, sequence) == GTK_EVENT_SEQUENCE_CLAIMED;
+
if (_gtk_gesture_update_point (gesture, event, FALSE))
{
if (was_recognized &&
@@ -701,6 +706,8 @@ gtk_gesture_handle_event (GtkEventController *controller,
_gtk_gesture_remove_point (gesture, event);
}
+
+ return was_claimed && was_recognized;
}
else if (event->type == GDK_MOTION_NOTIFY ||
event->type == GDK_TOUCH_UPDATE ||