[gtk+/gtk-3-10] x11: Handle all XI2 crossing mode values in switch



commit 25c087ed9293fcb511169af2443b75235da214f5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Dec 4 12:34:31 2013 +0100

    x11: Handle all XI2 crossing mode values in switch
    
    This fixes potential assertions if a GTK+ app gets to receive
    a XINotifyPassiveGrab/Ungrab pointer crossing event, currently
    triggerable by XIGrabEnter passive grabs.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=719762

 gdk/x11/gdkdevicemanager-xi2.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 0f20d58..5710ae1 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -780,12 +780,16 @@ translate_crossing_mode (gint mode)
 {
   switch (mode)
     {
-    case NotifyNormal:
+    case XINotifyNormal:
       return GDK_CROSSING_NORMAL;
-    case NotifyGrab:
+    case XINotifyGrab:
+    case XINotifyPassiveGrab:
       return GDK_CROSSING_GRAB;
-    case NotifyUngrab:
+    case XINotifyUngrab:
+    case XINotifyPassiveUngrab:
       return GDK_CROSSING_UNGRAB;
+    case XINotifyWhileGrabbed:
+      /* Fall through, unexpected in pointer crossing events */
     default:
       g_assert_not_reached ();
     }


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