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
This commit is contained in:
Carlos Garnacho 2014-07-08 18:20:26 +02:00
parent ec911dc8b9
commit 8d669ab8ce

View File

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