summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-06-29 15:43:31 +0200
committerCarlos Garnacho <carlosg@gnome.org>2017-07-12 23:15:12 +0200
commit3d77b4caa18589effa3d7d450f4eaf891520f739 (patch)
tree35897bcc536569736e3fd7cad021bbb155065b0a
parentb417ae73728c1a955f55b7a8cf7e498d9b1696f7 (diff)
downloadgnome-settings-daemon-3d77b4caa18589effa3d7d450f4eaf891520f739.tar.gz
common: Try harder to get devices' vendor/product from udev
If the device has no ID_VENDOR_ID/ID_MODEL_ID udev properties, resort to reading those from sysfs attributes. https://bugzilla.gnome.org/show_bug.cgi?id=784341
-rw-r--r--plugins/common/gsd-device-manager-udev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/common/gsd-device-manager-udev.c b/plugins/common/gsd-device-manager-udev.c
index 3fb378e2..f83f4334 100644
--- a/plugins/common/gsd-device-manager-udev.c
+++ b/plugins/common/gsd-device-manager-udev.c
@@ -90,6 +90,12 @@ create_device (GUdevDevice *udev_device)
name = g_udev_device_get_sysfs_attr (parent, "name");
vendor = g_udev_device_get_property (udev_device, "ID_VENDOR_ID");
product = g_udev_device_get_property (udev_device, "ID_MODEL_ID");
+
+ if (!vendor || !product) {
+ vendor = g_udev_device_get_sysfs_attr (udev_device, "device/id/vendor");
+ product = g_udev_device_get_sysfs_attr (udev_device, "device/id/product");
+ }
+
width = g_udev_device_get_property_as_int (udev_device, "ID_INPUT_WIDTH_MM");
height = g_udev_device_get_property_as_int (udev_device, "ID_INPUT_HEIGHT_MM");