mirror of
https://github.com/brl/mutter.git
synced 2025-02-21 07:24:09 +00:00
gesture-action: Unregister all tracked points on cancel
Ensure that when cancelling a gesture, either because a callback has returned FALSE or because clutter_gesture_action_cancel() has been called, the array tracking touch points is emptied and a whole new set of touch points is needed before restarting the gesture. https://bugzilla.gnome.org/show_bug.cgi?id=685221
This commit is contained in:
parent
abcf1d589f
commit
bd1febb2ea
@ -236,6 +236,8 @@ cancel_gesture (ClutterGestureAction *action)
|
|||||||
|
|
||||||
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
|
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
|
||||||
g_signal_emit (action, gesture_signals[GESTURE_CANCEL], 0, actor);
|
g_signal_emit (action, gesture_signals[GESTURE_CANCEL], 0, actor);
|
||||||
|
|
||||||
|
g_array_set_size (action->priv->points, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -301,7 +303,6 @@ stage_captured_event_cb (ClutterActor *stage,
|
|||||||
if (!(mods & CLUTTER_BUTTON1_MASK))
|
if (!(mods & CLUTTER_BUTTON1_MASK))
|
||||||
{
|
{
|
||||||
cancel_gesture (action);
|
cancel_gesture (action);
|
||||||
gesture_unregister_point (action, position);
|
|
||||||
return CLUTTER_EVENT_PROPAGATE;
|
return CLUTTER_EVENT_PROPAGATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -968,6 +969,4 @@ clutter_gesture_action_cancel (ClutterGestureAction *action)
|
|||||||
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
g_return_if_fail (CLUTTER_IS_GESTURE_ACTION (action));
|
||||||
|
|
||||||
cancel_gesture (action);
|
cancel_gesture (action);
|
||||||
|
|
||||||
g_array_set_size (action->priv->points, 0);
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user