From 83ed2afe34ce88347cc226912fe8c8515ba20e3a Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 18 Mar 2021 18:38:18 +0100 Subject: [PATCH] clutter: Ensure to reset touchpoints when disabling action The action might not have been triggered yet, as per its trigger threshold. This doesn't mean we shouldn't reset the point(s) accumulated so far. This fixes those touchpoints persisting after disable/enable, thus making gesture recognition fail from there on. Part-of: --- clutter/clutter/clutter-gesture-action.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-gesture-action.c b/clutter/clutter/clutter-gesture-action.c index ab69bcf37..f938a549a 100644 --- a/clutter/clutter/clutter-gesture-action.c +++ b/clutter/clutter/clutter-gesture-action.c @@ -572,8 +572,13 @@ clutter_gesture_action_set_enabled (ClutterActorMeta *meta, ClutterGestureActionPrivate *priv = clutter_gesture_action_get_instance_private (gesture_action); - if (!is_enabled && priv->in_gesture) - cancel_gesture (gesture_action); + if (!is_enabled) + { + if (priv->in_gesture) + cancel_gesture (gesture_action); + else + g_array_set_size (priv->points, 0); + } meta_class->set_enabled (meta, is_enabled); }