[gnome-settings-daemon] wacom: check for the new HID unified kernel ABI when setting OLEDs



commit f08b12ee66d4016c3d86b23e581e741e73a55076
Author: Benjamin Tissoires <benjamin tissoires redhat com>
Date:   Tue Aug 12 10:52:28 2014 -0400

    wacom: check for the new HID unified kernel ABI when setting OLEDs
    
    In kernel v3.17 and later, the Wacom OLED sysfs attribute is located under
    the HID node, not the USB one. This new path is now common between USB
    and Bluetooth, so no special handling is required for Bluetooth to
    retrieve this path.
    
    Check for its availability first, and then fall back on the old path.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734458

 plugins/wacom/gsd-wacom-oled-helper.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-oled-helper.c b/plugins/wacom/gsd-wacom-oled-helper.c
index 784c9c7..e278df6 100644
--- a/plugins/wacom/gsd-wacom-oled-helper.c
+++ b/plugins/wacom/gsd-wacom-oled-helper.c
@@ -222,6 +222,19 @@ get_oled_sys_path (GUdevClient      *client,
        GUdevDevice *parent;
        char *filename = NULL;
 
+       /* check for new unified hid implementation first */
+       parent = g_udev_device_get_parent_with_subsystem (device, "hid", NULL);
+       if (parent) {
+               filename = get_oled_sysfs_path (parent, button_num);
+               g_object_unref (parent);
+               if(g_file_test (filename, G_FILE_TEST_EXISTS)) {
+                       *type = GSD_WACOM_OLED_TYPE_USB;
+                       return filename;
+               }
+               g_clear_pointer (&filename, g_free);
+       }
+
+       /* old kernel */
        if (usb) {
                parent = g_udev_device_get_parent_with_subsystem (device, "usb", "usb_interface");
                if (!parent)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]