summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-03-18 18:38:18 +0100
committerCarlos Garnacho <carlosg@gnome.org>2021-03-18 20:44:56 +0100
commit34e3ffaaf5224c8b06f8dd6027ae9d6c18f720e2 (patch)
treedfcdc417c23288a6fe9cb78e392aba0a2a3aefb7
parentdf91fd10cec1684978cbb7496f4a9184ba0ccb6f (diff)
downloadmutter-wip/carlosg/app-grid-gestures.tar.gz
clutter: Ensure to reset touchpoints when disabling actionwip/carlosg/app-grid-gestures
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.
-rw-r--r--clutter/clutter/clutter-gesture-action.c9
1 files 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);
}