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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1791>
This commit is contained in:
Carlos Garnacho 2021-03-18 18:38:18 +01:00 committed by Marge Bot
parent b0a0be3ccc
commit 83ed2afe34

View File

@ -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);
}