diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2014-05-07 19:08:50 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2014-05-23 19:54:30 +0200 |
commit | fe9685bca12c0f8b8538f65c49f1d57f82ad08bb (patch) | |
tree | 15db840378ec77cb445b5de752d87ca661bc3096 /gtk/gtkgesture.c | |
parent | 6e9b054543213692f47740143497d87786843a75 (diff) | |
download | gtk+-fe9685bca12c0f8b8538f65c49f1d57f82ad08bb.tar.gz |
widget: tighten the conditions at which a press event is emulated
Make it really sure that the event is only emitted after every gesture
that consumed the button press is done with the sequence.
The event must only be emulated if a gesture in the capture phase happened
to consume the event, be cancelled, and
Diffstat (limited to 'gtk/gtkgesture.c')
-rw-r--r-- | gtk/gtkgesture.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c index 420ad9ffa3..e738e61c1c 100644 --- a/gtk/gtkgesture.c +++ b/gtk/gtkgesture.c @@ -510,7 +510,10 @@ gtk_gesture_handle_event (GtkEventController *controller, PointData *data; data = g_hash_table_lookup (priv->points, sequence); - data->press_handled = TRUE; + + /* If the sequence was claimed early, the press event will be consumed */ + if (gtk_gesture_get_sequence_state (gesture, sequence) == GTK_EVENT_SEQUENCE_CLAIMED) + data->press_handled = TRUE; } break; @@ -820,7 +823,7 @@ gtk_gesture_set_sequence_state (GtkGesture *gesture, return FALSE; if (data->state == state) - return TRUE; + return FALSE; /* denied sequences remain denied */ if (data->state == GTK_EVENT_SEQUENCE_DENIED) |