Blame SOURCES/0001-Skip-wacom-touchpads-when-updating-setting.patch

7cc7ff
From dafc9cb414fd47112b972d34c205e73797a3c1c1 Mon Sep 17 00:00:00 2001
7cc7ff
From: Carlos Garnacho <carlosg@gnome.org>
7cc7ff
Date: Fri, 21 Feb 2020 16:45:35 +0100
7cc7ff
Subject: [PATCH] Skip wacom touchpads when updating setting
7cc7ff
7cc7ff
---
7cc7ff
 src/backends/meta-input-settings.c | 46 +++++++++++++++++++++++-------
7cc7ff
 1 file changed, 36 insertions(+), 10 deletions(-)
7cc7ff
7cc7ff
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
7cc7ff
index cdff7b346..7d866594a 100644
7cc7ff
--- a/src/backends/meta-input-settings.c
7cc7ff
+++ b/src/backends/meta-input-settings.c
7cc7ff
@@ -569,20 +569,33 @@ update_touchpad_tap_enabled (MetaInputSettings  *input_settings,
7cc7ff
 
7cc7ff
   priv = meta_input_settings_get_instance_private (input_settings);
7cc7ff
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
7cc7ff
-  enabled = device_is_tablet_touchpad (input_settings, device) ||
7cc7ff
-    g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
7cc7ff
 
7cc7ff
   if (device)
7cc7ff
     {
7cc7ff
+      enabled = device_is_tablet_touchpad (input_settings, device) ||
7cc7ff
+        g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
7cc7ff
       settings_device_set_bool_setting (input_settings, device,
7cc7ff
                                         input_settings_class->set_tap_enabled,
7cc7ff
                                         enabled);
7cc7ff
     }
7cc7ff
   else
7cc7ff
     {
7cc7ff
-      settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
7cc7ff
-                                 input_settings_class->set_tap_enabled,
7cc7ff
-                                 enabled);
7cc7ff
+      const GSList *devices, *l;
7cc7ff
+
7cc7ff
+      devices = clutter_device_manager_peek_devices (priv->device_manager);
7cc7ff
+      for (l = devices; l; l = l->next)
7cc7ff
+        {
7cc7ff
+          device = l->data;
7cc7ff
+
7cc7ff
+          if (clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
7cc7ff
+            continue;
7cc7ff
+
7cc7ff
+          enabled = device_is_tablet_touchpad (input_settings, device) ||
7cc7ff
+            g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
7cc7ff
+          settings_device_set_bool_setting (input_settings, device,
7cc7ff
+                                            input_settings_class->set_tap_enabled,
7cc7ff
+                                            enabled);
7cc7ff
+        }
7cc7ff
     }
7cc7ff
 }
7cc7ff
 
7cc7ff
@@ -600,20 +613,33 @@ update_touchpad_tap_and_drag_enabled (MetaInputSettings  *input_settings,
7cc7ff
 
7cc7ff
   priv = meta_input_settings_get_instance_private (input_settings);
7cc7ff
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
7cc7ff
-  enabled = device_is_tablet_touchpad (input_settings, device) ||
7cc7ff
-    g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
7cc7ff
 
7cc7ff
   if (device)
7cc7ff
     {
7cc7ff
+      enabled = device_is_tablet_touchpad (input_settings, device) ||
7cc7ff
+        g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
7cc7ff
       settings_device_set_bool_setting (input_settings, device,
7cc7ff
                                         input_settings_class->set_tap_and_drag_enabled,
7cc7ff
                                         enabled);
7cc7ff
     }
7cc7ff
   else
7cc7ff
     {
7cc7ff
-      settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
7cc7ff
-                                 input_settings_class->set_tap_and_drag_enabled,
7cc7ff
-                                 enabled);
7cc7ff
+      const GSList *devices, *l;
7cc7ff
+
7cc7ff
+      devices = clutter_device_manager_peek_devices (priv->device_manager);
7cc7ff
+      for (l = devices; l; l = l->next)
7cc7ff
+        {
7cc7ff
+          device = l->data;
7cc7ff
+
7cc7ff
+          if (clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
7cc7ff
+            continue;
7cc7ff
+
7cc7ff
+          enabled = device_is_tablet_touchpad (input_settings, device) ||
7cc7ff
+            g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
7cc7ff
+          settings_device_set_bool_setting (input_settings, device,
7cc7ff
+                                            input_settings_class->set_tap_and_drag_enabled,
7cc7ff
+                                            enabled);
7cc7ff
+        }
7cc7ff
     }
7cc7ff
 }
7cc7ff
 
7cc7ff
-- 
7cc7ff
2.24.1
7cc7ff