Make sure the gesture is cancelled even if we miss the release event

This commit is contained in:
Tomeu Vizoso 2011-07-14 13:11:12 +02:00
parent 439c7e6ee7
commit 01cf70594d

View File

@ -133,6 +133,18 @@ stage_captured_event_cb (ClutterActor *stage,
{
case CLUTTER_MOTION:
{
ClutterModifierType mods = clutter_event_get_state (event);
/* we might miss a button-release event in case of grabs,
* so we need to check whether the button is still down
* during a motion event
*/
if (!(mods & CLUTTER_BUTTON1_MASK))
{
cancel_gesture (action);
return FALSE;
}
clutter_event_get_coords (event, &priv->last_motion_x,
&priv->last_motion_y);