[gnome-settings-daemon] wacom: Add both tablet and touchscreen devices on initial iteration



commit 08424fb6c134765216bdf032457fa19ef44ebe16
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Sep 22 17:52:06 2017 +0200

    wacom: Add both tablet and touchscreen devices on initial iteration
    
    The GsdDeviceManager::device-added callback would observe both
    display-attached tablets and touchscreens, but only the former were
    added in the initial loop.
    
    This made touchscreens not properly mapped to outputs, as touchscreens
    are usually built into the device.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787884

 plugins/wacom/gsd-wacom-manager.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 3bcbca4..b6d71f9 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -304,6 +304,19 @@ device_removed_cb (GsdDeviceManager *device_manager,
 }
 
 static void
+add_devices (GsdWacomManager *manager,
+             GsdDeviceType    device_type)
+{
+        GList *devices, *l;
+
+        devices = gsd_device_manager_list_devices (manager->priv->device_manager,
+                                                   device_type);
+        for (l = devices; l ; l = l->next)
+               device_added_cb (manager->priv->device_manager, l->data, manager);
+        g_list_free (devices);
+}
+
+static void
 set_devicepresence_handler (GsdWacomManager *manager)
 {
         GsdDeviceManager *device_manager;
@@ -325,19 +338,14 @@ gsd_wacom_manager_init (GsdWacomManager *manager)
 static gboolean
 gsd_wacom_manager_idle_cb (GsdWacomManager *manager)
 {
-       GList *devices, *l;
-
         gnome_settings_profile_start (NULL);
 
         manager->priv->device_mapper = gsd_device_mapper_get ();
 
         set_devicepresence_handler (manager);
 
-        devices = gsd_device_manager_list_devices (manager->priv->device_manager,
-                                                   GSD_DEVICE_TYPE_TABLET);
-        for (l = devices; l ; l = l->next)
-               device_added_cb (manager->priv->device_manager, l->data, manager);
-        g_list_free (devices);
+        add_devices (manager, GSD_DEVICE_TYPE_TABLET);
+        add_devices (manager, GSD_DEVICE_TYPE_TOUCHSCREEN);
 
         gnome_settings_profile_end (NULL);
 


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