diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2012-06-04 13:15:13 +0200 |
---|---|---|
committer | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2012-06-05 15:59:52 +0200 |
commit | 0ec01a2e42645b4fe9ce23335983d326249afff3 (patch) | |
tree | 88b06f247db9a91abcd947324609639daba0b4b2 /clutter/clutter-main.c | |
parent | d7f68f64d37411bf764a096c5e50cb03c2112ce7 (diff) | |
download | clutter-0ec01a2e42645b4fe9ce23335983d326249afff3.tar.gz |
events: Deliver touch events to actors
https://bugzilla.gnome.org/show_bug.cgi?id=677390
Diffstat (limited to 'clutter/clutter-main.c')
-rw-r--r-- | clutter/clutter-main.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 7e4bef8c2..744301bb4 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; |