summaryrefslogtreecommitdiff
path: root/src/backends/native/meta-input-settings-native.c
diff options
context:
space:
mode:
authorfreeroot <free.r@gmx.fr>2017-08-18 01:00:10 +0200
committerJonas Ã…dahl <jadahl@gmail.com>2017-08-20 09:27:28 +0800
commit12792f99a06ebccbee9895e3a7325f3ee47133a4 (patch)
treee8572db76fc934823032cd7fcf2b76f872adf3a4 /src/backends/native/meta-input-settings-native.c
parent66996dee4bf2ab9bf8a1b6aee798e33f5587d83a (diff)
downloadmutter-12792f99a06ebccbee9895e3a7325f3ee47133a4.tar.gz
Add tag-and-drag setting from libinput into mutter
The problem is that libinput offers the possibility to not enabled dragging when tap-to-click is enabled but mutter doesn't. For people who have a sensitive touchpad and who like tap-to-click option, dragging is launched even when you don't want it : for example, when you select a folder, most of the time the folder is dragging whereas just selected or when you want to select some lines of a text file, several lines are moved as a cut-paste which is not expected and erase datas. To fix it, you need to have the possibility to desactivate the drag option when you use tap-to-click in mutter. Because it's already a specification of libinput, it remains to add it to mutter. Implementation with X11 is added too. https://bugzilla.gnome.org/show_bug.cgi?id=775755
Diffstat (limited to 'src/backends/native/meta-input-settings-native.c')
-rw-r--r--src/backends/native/meta-input-settings-native.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/backends/native/meta-input-settings-native.c b/src/backends/native/meta-input-settings-native.c
index f0d7057fb..8a62bb3fe 100644
--- a/src/backends/native/meta-input-settings-native.c
+++ b/src/backends/native/meta-input-settings-native.c
@@ -122,6 +122,24 @@ meta_input_settings_native_set_tap_enabled (MetaInputSettings *settings,
}
static void
+meta_input_settings_native_set_tap_and_drag_enabled (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled)
+{
+ struct libinput_device *libinput_device;
+
+ libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ if (!libinput_device)
+ return;
+
+ if (libinput_device_config_tap_get_finger_count (libinput_device) > 0)
+ libinput_device_config_tap_set_drag_enabled (libinput_device,
+ enabled ?
+ LIBINPUT_CONFIG_DRAG_ENABLED :
+ LIBINPUT_CONFIG_DRAG_DISABLED);
+}
+
+static void
meta_input_settings_native_set_disable_while_typing (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled)
@@ -530,6 +548,7 @@ meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
input_settings_class->set_speed = meta_input_settings_native_set_speed;
input_settings_class->set_left_handed = meta_input_settings_native_set_left_handed;
input_settings_class->set_tap_enabled = meta_input_settings_native_set_tap_enabled;
+ input_settings_class->set_tap_and_drag_enabled = meta_input_settings_native_set_tap_and_drag_enabled;
input_settings_class->set_invert_scroll = meta_input_settings_native_set_invert_scroll;
input_settings_class->set_edge_scroll = meta_input_settings_native_set_edge_scroll;
input_settings_class->set_two_finger_scroll = meta_input_settings_native_set_two_finger_scroll;