[clutter] gdk: Ignore synthesized leave events out of touch events



commit 7ed3714a94dbac1022b3e123e9243b501b01c6cd
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Jun 6 20:10:13 2015 +0200

    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 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/clutter/gdk/clutter-event-gdk.c b/clutter/gdk/clutter-event-gdk.c
index 9f7dec7..9433418 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",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]