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:13:38 +0200
commitb1d12b03f42e8383e1ef843d63bec8595b68ae41 (patch)
tree3818b84ab0b0374c5b42ca2462bb942867a72cec
parentd0ff81426266d3873afdbdf52cb817275caaf5d6 (diff)
downloadgnome-settings-daemon-b1d12b03f42e8383e1ef843d63bec8595b68ae41.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");