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.
This commit is contained in:
Carlos Garnacho 2017-05-24 18:22:00 +02:00
parent 8371b6b857
commit f8bc56dd55

View File

@ -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 ||