events: honour clutter_stage_set_motion_events_enabled() for touch events

When dragging/scrolling using touch events, we want the same behaviour
than for motion events. We need to honor the user's calls to
clutter_stage_set_motion_events_enabled() to deactive event
bubbling/captured sequences on the actor located under the pointer and
just transmit events to the stage/grab actor.

https://bugzilla.gnome.org/show_bug.cgi?id=680751
This commit is contained in:
Lionel Landwerlin 2012-07-28 15:36:23 +02:00
parent fc04f015a6
commit 86e064597e

View File

@ -2633,8 +2633,40 @@ _clutter_process_event_details (ClutterActor *stage,
break; break;
} }
case CLUTTER_TOUCH_BEGIN:
case CLUTTER_TOUCH_UPDATE: case CLUTTER_TOUCH_UPDATE:
/* only the stage gets motion events if they are enabled */
if (!clutter_stage_get_motion_events_enabled (CLUTTER_STAGE (stage)) &&
event->any.source == NULL)
{
ClutterActor *grab_actor = NULL;
/* Only stage gets motion events */
event->any.source = stage;
/* global grabs */
if (device->sequence_grab_actors != NULL)
{
grab_actor = g_hash_table_lookup (device->sequence_grab_actors,
event->touch.sequence);
}
if (grab_actor != NULL)
{
clutter_actor_event (grab_actor, event, FALSE);
break;
}
/* Trigger handlers on stage in both capture .. */
if (!clutter_actor_event (stage, event, TRUE))
{
/* and bubbling phase */
clutter_actor_event (stage, event, FALSE);
}
break;
}
/* fallthrough from motion */
case CLUTTER_TOUCH_BEGIN:
case CLUTTER_TOUCH_END: case CLUTTER_TOUCH_END:
{ {
ClutterActor *actor; ClutterActor *actor;