summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2012-06-04 13:15:13 +0200
committerTomeu Vizoso <tomeu.vizoso@collabora.com>2012-06-05 17:05:30 +0200
commit6ded96b3971ede454ff4ca7d22208d947028a6ad (patch)
tree51212ad926e05de14c37699d993661a04730051f
parentcd76ab7c2a74263774dc23779a8e9dcd5a656879 (diff)
downloadclutter-6ded96b3971ede454ff4ca7d22208d947028a6ad.tar.gz
events: Deliver touch events to actors
-rw-r--r--clutter/clutter-main.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index b98e0b0d2..573a25b0b 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -2614,6 +2614,40 @@ _clutter_process_event_details (ClutterActor *stage,
case CLUTTER_TOUCH_BEGIN:
case CLUTTER_TOUCH_UPDATE:
case CLUTTER_TOUCH_END:
+ {
+ ClutterActor *actor;
+ gfloat x, y;
+
+ clutter_event_get_coords (event, &x, &y);
+
+ /* Only do a pick to find the source if source is not already set
+ * (as it could be in a synthetic event)
+ */
+ if (event->any.source == NULL)
+ {
+ actor = _clutter_stage_do_pick (CLUTTER_STAGE (stage),
+ x, y,
+ CLUTTER_PICK_REACTIVE);
+ if (actor == NULL)
+ break;
+
+ event->any.source = actor;
+ }
+ else
+ {
+ /* use the source already set in the synthetic event */
+ actor = event->any.source;
+ }
+
+ CLUTTER_NOTE (EVENT,
+ "Reactive event received at %.2f, %.2f - actor: %p",
+ x, y,
+ actor);
+
+ emit_pointer_event (event, device);
+ break;
+ }
+
case CLUTTER_TOUCH_CANCEL:
break;