From 7ed3714a94dbac1022b3e123e9243b501b01c6cd Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 6 Jun 2015 20:10:13 +0200 Subject: [PATCH] gdk: Ignore synthesized leave events out of touch events Certain crossing modes notify about synthesized events, where the pointer didn't really leave the window. Unsetting the stage from the device at that time is incorrect, and will leave all remaining touches unable to pick coordinates, so silently eaten away. https://bugzilla.gnome.org/show_bug.cgi?id=750496 --- clutter/gdk/clutter-event-gdk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clutter/gdk/clutter-event-gdk.c b/clutter/gdk/clutter-event-gdk.c index 9f7dec7a8..9433418a2 100644 --- a/clutter/gdk/clutter-event-gdk.c +++ b/clutter/gdk/clutter-event-gdk.c @@ -248,7 +248,10 @@ clutter_gdk_handle_event (GdkEvent *gdk_event) clutter_event_set_source_device (event, source_device); if (gdk_event->type == GDK_ENTER_NOTIFY) _clutter_input_device_set_stage (clutter_event_get_device (event), stage); - else + else if (gdk_event->type == GDK_LEAVE_NOTIFY && + gdk_event->crossing.mode != GDK_CROSSING_TOUCH_BEGIN && + gdk_event->crossing.mode != GDK_CROSSING_TOUCH_END && + gdk_event->crossing.mode != GDK_CROSSING_DEVICE_SWITCH) _clutter_input_device_set_stage (clutter_event_get_device (event), NULL); CLUTTER_NOTE (EVENT, "Crossing %s [%.2f, %.2f]", event->type == CLUTTER_ENTER ? "enter" : "leave",