x11: Use XInternAtom directly on poking device hardware IDs
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 30 Jun 2015 14:28:59 +0000 (16:28 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 6 Apr 2016 13:43:29 +0000 (15:43 +0200)
This way we don't cache the property if it wasn't previously there,
added by the driver itself. Bailing out is due there.

gdk/x11/gdkdevicemanager-xi2.c

index 310e24ec9f1820f8e2c59f54d6211934a4d0535d..497a18a9fd25cb3870b388ae9567bb8e1b0d2dd5 100644 (file)
@@ -345,13 +345,17 @@ get_device_ids (GdkDisplay    *display,
   gulong nitems, bytes_after;
   guint32 *data;
   int rc, format;
-  Atom type;
+  Atom prop, type;
 
   gdk_x11_display_error_trap_push (display);
 
+  prop = XInternAtom (GDK_DISPLAY_XDISPLAY (display), "Device Product ID", True);
+
+  if (prop == None)
+    return 0;
+
   rc = XIGetProperty (GDK_DISPLAY_XDISPLAY (display),
-                      info->deviceid,
-                      gdk_x11_get_xatom_by_name_for_display (display, "Device Product ID"),
+                      info->deviceid, prop,
                       0, 2, False, XA_INTEGER, &type, &format, &nitems, &bytes_after,
                       (guchar **) &data);
   gdk_x11_display_error_trap_pop_ignored (display);