[clutter] evdev: Set vendor/product IDs on input devices
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] evdev: Set vendor/product IDs on input devices
- Date: Fri, 9 Jan 2015 16:02:32 +0000 (UTC)
commit f5f523c63ae1f7c2fa6a4d5b097db869af0b0186
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 25 21:11:03 2014 +0100
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 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/clutter/evdev/clutter-input-device-evdev.c b/clutter/evdev/clutter-input-device-evdev.c
index cdd38a7..bcf7baf 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]