From f22ea7399ca7f1bb5ee01e651bb9dc6113e67a36 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 29 Oct 2021 12:52:52 +0200 Subject: [PATCH] clutter: Cancel ClutterGestureActions on leave+grab_notify events The lack of handling of regular crossing events here is dubious, perhaps to be fixed later on. So far, ensure gestures are cancelled whenever a grab-inducted crossing event would leave this action in the blue. Part-of: --- clutter/clutter/clutter-gesture-action.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clutter/clutter/clutter-gesture-action.c b/clutter/clutter/clutter-gesture-action.c index a4f2de792..5ff975495 100644 --- a/clutter/clutter/clutter-gesture-action.c +++ b/clutter/clutter/clutter-gesture-action.c @@ -380,6 +380,15 @@ clutter_gesture_action_handle_event (ClutterAction *action, return CLUTTER_EVENT_PROPAGATE; } + if (priv->in_gesture && point && + event_type == CLUTTER_LEAVE && + (event->crossing.flags & CLUTTER_EVENT_FLAG_GRAB_NOTIFY) != 0) + { + priv->in_gesture = FALSE; + cancel_gesture (gesture_action); + return CLUTTER_EVENT_PROPAGATE; + } + switch (clutter_event_type (event)) { case CLUTTER_BUTTON_PRESS: