From f5f523c63ae1f7c2fa6a4d5b097db869af0b0186 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 25 Nov 2014 21:11:03 +0100 Subject: [PATCH] evdev: Set vendor/product IDs on input devices This is fetched right away from libinput API. https://bugzilla.gnome.org/show_bug.cgi?id=740759 --- clutter/evdev/clutter-input-device-evdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clutter/evdev/clutter-input-device-evdev.c b/clutter/evdev/clutter-input-device-evdev.c index cdd38a7cb..bcf7bafc6 100644 --- a/clutter/evdev/clutter-input-device-evdev.c +++ b/clutter/evdev/clutter-input-device-evdev.c @@ -107,8 +107,11 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager, { ClutterInputDeviceEvdev *device; ClutterInputDeviceType type; + gchar *vendor, *product; type = _clutter_input_device_evdev_determine_type (libinput_device); + vendor = g_strdup_printf ("%.4x", libinput_device_get_id_vendor (libinput_device)); + product = g_strdup_printf ("%.4x", libinput_device_get_id_product (libinput_device)); device = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_EVDEV, "id", global_device_id_next++, "name", libinput_device_get_sysname (libinput_device), @@ -116,6 +119,8 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager, "device-type", type, "device-mode", CLUTTER_INPUT_MODE_SLAVE, "enabled", TRUE, + "vendor-id", vendor, + "product-id", product, NULL); device->seat = seat; @@ -123,6 +128,8 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager, libinput_device_set_user_data (libinput_device, device); libinput_device_ref (libinput_device); + g_free (vendor); + g_free (product); return CLUTTER_INPUT_DEVICE (device); }