[gtk+/xi2] Don't try to enable extension events on master devices.



commit 24af72e54688405df7d2ae6aefe51703e5989dc0
Author: Carlos Garnacho <carlos gnome org>
Date:   Sun Oct 11 01:19:44 2009 +0200

    Don't try to enable extension events on master devices.

 gdk/x11/gdkinput.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c
index 6ec0aa8..f6cc890 100644
--- a/gdk/x11/gdkinput.c
+++ b/gdk/x11/gdkinput.c
@@ -370,24 +370,28 @@ gdk_device_free_history (GdkTimeCoord **events,
 
 static void
 _gdk_input_select_device_events (GdkWindow *impl_window,
-                                 GdkDevice *dev)
+                                 GdkDevice *device)
 {
   guint event_mask;
   GdkWindowObject *w;
   GdkInputWindow *iw;
   GdkInputMode mode;
   gboolean has_cursor;
+  GdkDeviceType type;
   GList *l;
 
   event_mask = 0;
   iw = ((GdkWindowObject *)impl_window)->input_window;
 
-  g_object_get (dev,
+  g_object_get (device,
+                "type", &type,
                 "input-mode", &mode,
                 "has-cursor", &has_cursor,
                 NULL);
 
-  if (iw == NULL || mode == GDK_MODE_DISABLED)
+  if (iw == NULL ||
+      mode == GDK_MODE_DISABLED ||
+      type == GDK_DEVICE_TYPE_MASTER)
     return;
 
   for (l = iw->windows; l != NULL; l = l->next)
@@ -401,7 +405,7 @@ _gdk_input_select_device_events (GdkWindow *impl_window,
           if (event_mask)
             event_mask |= GDK_PROXIMITY_OUT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK;
 
-          gdk_window_set_device_events ((GdkWindow *) w, dev, event_mask);
+          gdk_window_set_device_events ((GdkWindow *) w, device, event_mask);
         }
     }
 }



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