From 318d0d596509a5eb2fb74f02c85b52b416e9891d Mon Sep 17 00:00:00 2001 From: Emanuele Aina Date: Fri, 5 Oct 2012 14:34:20 +0200 Subject: [PATCH] events: Deliver touch events that continue off stage (soft grab) If a button press happen on stage and the pointer is moved outside the stage while holding the mouse button, the motion and release events are still delivered to actors. Do the same X11 soft grab emulation for touch events. https://bugzilla.gnome.org/show_bug.cgi?id=685589 --- clutter/clutter-main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 089dc5af3..46ae7d881 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -2700,6 +2700,27 @@ _clutter_process_event_details (ClutterActor *stage, */ if (event->any.source == NULL) { + /* same as the mouse events above, emulate the X11 implicit + * soft grab */ + if (is_off_stage (stage, x, y)) + { + CLUTTER_NOTE (EVENT, + "Touch %s off stage received at %.2f, %.2f", + event->type == CLUTTER_TOUCH_UPDATE ? "Touch update" : + event->type == CLUTTER_TOUCH_END ? "Touch end" : + event->type == CLUTTER_TOUCH_CANCEL ? "Touch cancel" : + "?", x, y); + + event->button.source = stage; + + emit_touch_event (event, device); + + if (event->type == CLUTTER_TOUCH_END) + _clutter_input_device_remove_event_sequence (device, event); + + break; + } + if (device != NULL) actor = _clutter_input_device_update (device, sequence, TRUE); else