gdk: Set vid/pid on wayland tablets
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 16 Jun 2017 16:21:34 +0000 (18:21 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 16 Jun 2017 17:30:10 +0000 (19:30 +0200)
This was missed so far... Use %.4x format, in order to behave just
the same than X11.

gdk/wayland/gdkdevice-wayland.c

index c9eea731eb57d128633109bca1462aaad4f42f1d..33ecf404a7d13533608a83d798e768c4ae8d463b 100644 (file)
@@ -2866,6 +2866,10 @@ tablet_handle_done (void                 *data,
     GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
   GdkDevice *master, *stylus_device, *eraser_device;
   gchar *master_name, *eraser_name;
+  gchar *vid, *pid;
+
+  vid = g_strdup_printf ("%.4x", tablet->vid);
+  pid = g_strdup_printf ("%.4x", tablet->pid);
 
   master_name = g_strdup_printf ("Master pointer for %s", tablet->name);
   master = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
@@ -2891,6 +2895,8 @@ tablet_handle_done (void                 *data,
                                 "display", display,
                                 "device-manager", device_manager,
                                 "seat", seat,
+                                "vendor-id", vid,
+                                "product-id", pid,
                                 NULL);
 
   eraser_device = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
@@ -2902,6 +2908,8 @@ tablet_handle_done (void                 *data,
                                 "display", display,
                                 "device-manager", device_manager,
                                 "seat", seat,
+                                "vendor-id", vid,
+                                "product-id", pid,
                                 NULL);
 
   tablet->master = master;
@@ -2925,6 +2933,8 @@ tablet_handle_done (void                 *data,
 
   g_free (eraser_name);
   g_free (master_name);
+  g_free (vid);
+  g_free (pid);
 }
 
 static void