From dca2f4386dbbefe842efd4bcab5fcd0b661b72dd Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 20 Nov 2014 13:25:40 +0100 Subject: gesturesingle: check for the sequence being handled, not just the event Checking the return value was valid for most gestures, but GtkGestureLongPress, where the first press triggers internally an action, but does nothing for the sequence to be claimed/denied, FALSE was eventually returned, and the button/sequence functions would be incorrect when ::pressed is emitted. So check that the sequence is being handled by the gesture, this is more desirable than the return value as it's independent of sequence state, and still will be FALSE for the cases we want to catch here. --- gtk/gtkgesturesingle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gtk/gtkgesturesingle.c') diff --git a/gtk/gtkgesturesingle.c b/gtk/gtkgesturesingle.c index c549e6d23d..458bffe5ec 100644 --- a/gtk/gtkgesturesingle.c +++ b/gtk/gtkgesturesingle.c @@ -220,7 +220,8 @@ gtk_gesture_single_handle_event (GtkEventController *controller, if (sequence == priv->current_sequence && (event->type == GDK_BUTTON_RELEASE || event->type == GDK_TOUCH_END)) priv->current_button = 0; - else if (!retval) + else if (priv->current_sequence == sequence && + !gtk_gesture_handles_sequence (GTK_GESTURE (controller), sequence)) { if (button == priv->current_button && event->type == GDK_BUTTON_PRESS) priv->current_button = 0; -- cgit v1.2.1