[gnome-control-center/wip/carlosg/ekr-loves-27qhd: 4/4] wacom: Group pad/stylus devices together with the group name



commit dc09c4fdf8647a9da0abe474106c3426db58c9ea
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Dec 5 15:56:39 2019 +0100

    wacom: Group pad/stylus devices together with the group name
    
    This will cover the regular case of pads attached to a tablet, but
    also the EKR case where the pad is a separate device logically
    grouped with a tablet.
    
    https://gitlab.gnome.org/GNOME/gnome-control-center/issues/415

 panels/wacom/cc-wacom-page.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/panels/wacom/cc-wacom-page.c b/panels/wacom/cc-wacom-page.c
index 54ff2e39c..81808b666 100644
--- a/panels/wacom/cc-wacom-page.c
+++ b/panels/wacom/cc-wacom-page.c
@@ -933,15 +933,13 @@ check_add_pad (CcWacomPage *page,
        if ((gsd_device_get_device_type (gsd_device) & GSD_DEVICE_TYPE_PAD) == 0)
                return;
 
-       wacom_device = cc_wacom_device_new (gsd_device);
-       if (!wacom_device)
+       if (!gsd_device_shares_group (cc_wacom_device_get_device (page->stylus),
+                                     gsd_device))
                return;
 
-       if (g_strcmp0 (cc_wacom_device_get_name (page->stylus),
-                      cc_wacom_device_get_name (wacom_device)) != 0) {
-               g_object_unref (wacom_device);
+       wacom_device = cc_wacom_device_new (gsd_device);
+       if (!wacom_device)
                return;
-       }
 
        page->pads = g_list_prepend (page->pads, wacom_device);
        update_pad_availability (page);


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