diff options
author | Rui Matos <tiagomatos@gmail.com> | 2015-05-08 17:36:55 +0200 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2015-05-08 17:44:59 +0200 |
commit | dac30a222ed9ddbb0be519be948c80d4f0cf303c (patch) | |
tree | bdd72206f035b6bb9c4e5960b3f4a2bec3e1ae19 | |
parent | 7d1b593fbd85a6fc9a60cfe991a4bfa92717f778 (diff) |
input-settings-x11: Honor default value for click method setting
Now that xf86-input-libinput exposes default values we can honor the
gsettings value.
https://bugzilla.gnome.org/show_bug.cgi?id=746290
-rw-r--r-- | src/backends/x11/meta-input-settings-x11.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c index 6ef219ff..f683c478 100644 --- a/src/backends/x11/meta-input-settings-x11.c +++ b/src/backends/x11/meta-input-settings-x11.c @@ -26,6 +26,7 @@ #include "meta-backend-x11.h" #include "meta-input-settings-x11.h" +#include <string.h> #include <gdk/gdkx.h> #include <X11/Xatom.h> #include <X11/extensions/XInput2.h> @@ -219,16 +220,23 @@ meta_input_settings_x11_set_click_method (MetaInputSettings *settings, GDesktopTouchpadClickMethod mode) { guchar values[2] = { 0 }; /* buttonareas, clickfinger */ + guchar *defaults; switch (mode) { + case G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT: + defaults = get_property (device, "libinput Click Method Enabled Default", + XA_INTEGER, 8, 2); + if (!defaults) + break; + memcpy (values, defaults, 2); + meta_XFree (defaults); + break; case G_DESKTOP_TOUCHPAD_CLICK_METHOD_NONE: break; case G_DESKTOP_TOUCHPAD_CLICK_METHOD_AREAS: values[0] = 1; break; - case G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT: - /* XXX: We can't be much smarter yet, x11 doesn't expose default settings */ case G_DESKTOP_TOUCHPAD_CLICK_METHOD_FINGERS: values[1] = 1; break; |