[mutter/wip/carlosg/wacom-tap-fix: 2/2] backends: Fix configuration changes to tap[-and-drag]
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/wacom-tap-fix: 2/2] backends: Fix configuration changes to tap[-and-drag]
- Date: Tue, 24 Mar 2020 12:52:03 +0000 (UTC)
commit ae3139d4007de70f6a8bb216855ebf9560a5ed5b
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Mar 24 13:16:11 2020 +0100
backends: Fix configuration changes to tap[-and-drag]
Most people just see a harmless warning when applying this setting to
all touchpads (which this patch fixes). But tap[-and-drag] is supposed
to remain enabled for display-less Wacom tablets, despite configuration
changes.
Fix this by using the mapping function, so the setting is forced on for
wacom devices. This happens on a per-device basis, so the warning is
gone too.
src/backends/meta-input-settings.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 6d674bbea..7c3afdaff 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -592,6 +592,14 @@ device_is_tablet_touchpad (MetaInputSettings *input_settings,
return FALSE;
}
+static gboolean
+force_enable_on_tablet (MetaInputSettings *input_settings,
+ ClutterInputDevice *device,
+ gboolean value)
+{
+ return device_is_tablet_touchpad (input_settings, device) || value;
+}
+
static void
update_touchpad_tap_enabled (MetaInputSettings *input_settings,
ClutterInputDevice *device)
@@ -606,18 +614,19 @@ update_touchpad_tap_enabled (MetaInputSettings *input_settings,
priv = meta_input_settings_get_instance_private (input_settings);
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
- enabled = device_is_tablet_touchpad (input_settings, device) ||
- g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
+ enabled = g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
if (device)
{
+ enabled = force_enable_on_tablet (input_settings, device, enabled);
settings_device_set_bool_setting (input_settings, device,
input_settings_class->set_tap_enabled,
enabled);
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ force_enable_on_tablet,
input_settings_class->set_tap_enabled,
enabled);
}
@@ -637,18 +646,19 @@ update_touchpad_tap_and_drag_enabled (MetaInputSettings *input_settings,
priv = meta_input_settings_get_instance_private (input_settings);
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
- enabled = device_is_tablet_touchpad (input_settings, device) ||
- g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
+ enabled = g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
if (device)
{
+ enabled = force_enable_on_tablet (input_settings, device, enabled);
settings_device_set_bool_setting (input_settings, device,
input_settings_class->set_tap_and_drag_enabled,
enabled);
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ force_enable_on_tablet,
input_settings_class->set_tap_and_drag_enabled,
enabled);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]