[gtk+] wayland: ensure gdk_device_manager_get_client_pointer() returns a master pointer



commit 001327d999ac6527f026d3875fa7a84371fe16bf
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Aug 13 21:16:39 2014 +0200

    wayland: ensure gdk_device_manager_get_client_pointer() returns a master pointer
    
    The internal ordering of devices isn't quite guaranteed, so ensure we're returning
    the right one.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697855

 gdk/wayland/gdkdevice-wayland.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 2ff888c..5fd6341 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1791,12 +1791,13 @@ gdk_wayland_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
 
   wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
 
-  /* Find the first pointer device */
+  /* Find the first master pointer device */
   for (l = wayland_device_manager->devices; l != NULL; l = l->next)
     {
       GdkDevice *device = l->data;
 
-      if (gdk_device_get_source (device) == GDK_SOURCE_MOUSE)
+      if (gdk_device_get_source (device) == GDK_SOURCE_MOUSE &&
+          gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER)
         return device;
     }
 


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