diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-06-29 15:43:31 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-07-12 23:15:12 +0200 |
commit | 3d77b4caa18589effa3d7d450f4eaf891520f739 (patch) | |
tree | 35897bcc536569736e3fd7cad021bbb155065b0a | |
parent | b417ae73728c1a955f55b7a8cf7e498d9b1696f7 (diff) | |
download | gnome-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.c | 6 |
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"); |