diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2014-11-20 13:25:40 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2014-12-18 21:20:17 +0100 |
commit | dca2f4386dbbefe842efd4bcab5fcd0b661b72dd (patch) | |
tree | c88b35bf7f7520c9681517dcd634390e62b44349 /gtk/gtkgesturesingle.c | |
parent | ce8dc5186127ae175610366671a30d69625ebaa9 (diff) | |
download | gtk+-dca2f4386dbbefe842efd4bcab5fcd0b661b72dd.tar.gz |
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.
Diffstat (limited to 'gtk/gtkgesturesingle.c')
-rw-r--r-- | gtk/gtkgesturesingle.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |