From 8d669ab8ceb9ad1cfb03e69d32e30033070961a6 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 8 Jul 2014 18:20:26 +0200 Subject: [PATCH] gesture-action: Prepare for clutter_gesture_action_cancel() within ::gesture-end There may be odd situations where full gesture cancellation may be wanted at once when the first touch is lifted and ::gesture-end is emitted on a gesture action. Although calling clutter_gesture_action_cancel() within the ::gesture-end handler causes 2 critical warnings that are otherwise harmless. https://bugzilla.gnome.org/show_bug.cgi?id=732907 --- clutter/clutter-gesture-action.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-gesture-action.c b/clutter/clutter-gesture-action.c index 78c72b8fd..ec2cb7bda 100644 --- a/clutter/clutter-gesture-action.c +++ b/clutter/clutter-gesture-action.c @@ -224,6 +224,9 @@ gesture_unregister_point (ClutterGestureAction *action, gint position) { ClutterGestureActionPrivate *priv = action->priv; + if (action->priv->points->len == 0) + return; + g_array_remove_index (priv->points, position); } @@ -480,7 +483,7 @@ stage_captured_event_cb (ClutterActor *stage, break; } - if (priv->points->len == 0) + if (priv->points->len == 0 && priv->stage_capture_id) { g_signal_handler_disconnect (priv->stage, priv->stage_capture_id); priv->stage_capture_id = 0;