diff options
author | Rui Matos <tiagomatos@gmail.com> | 2016-10-27 19:08:08 +0200 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2016-11-02 14:07:11 +0100 |
commit | fb5e591bc93dbbe5a37f7ad03652e7f89896abab (patch) | |
tree | b0cdcdfece19baf249663e3e51241e7945acf561 /src/backends/native/meta-input-settings-native.c | |
parent | bfb46ff85041b04538d899c581056c77214e3ae0 (diff) | |
download | mutter-fb5e591bc93dbbe5a37f7ad03652e7f89896abab.tar.gz |
MetaInputSettingsNative: allow unsetting click and scroll methods
Checking for supported methods isn't needed since libinput will just
error out and do nothing itself if a requested method isn't supported
and, in fact, this logic was preventing the enum values 0 from being
set.
https://bugzilla.gnome.org/show_bug.cgi?id=771744
Diffstat (limited to 'src/backends/native/meta-input-settings-native.c')
-rw-r--r-- | src/backends/native/meta-input-settings-native.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/backends/native/meta-input-settings-native.c b/src/backends/native/meta-input-settings-native.c index 7567543e0..5a142f77b 100644 --- a/src/backends/native/meta-input-settings-native.c +++ b/src/backends/native/meta-input-settings-native.c @@ -141,28 +141,18 @@ static gboolean device_set_scroll_method (struct libinput_device *libinput_device, enum libinput_config_scroll_method method) { - enum libinput_config_scroll_method supported; - - supported = libinput_device_config_scroll_get_methods (libinput_device); - - if (method & supported) + enum libinput_config_status status = libinput_device_config_scroll_set_method (libinput_device, method); - - return (method & supported) != 0; + return status == LIBINPUT_CONFIG_STATUS_SUCCESS; } static gboolean device_set_click_method (struct libinput_device *libinput_device, enum libinput_config_click_method method) { - enum libinput_config_click_method supported; - - supported = libinput_device_config_click_get_methods (libinput_device); - - if (method & supported) + enum libinput_config_status status = libinput_device_config_click_set_method (libinput_device, method); - - return (method & supported) != 0; + return status == LIBINPUT_CONFIG_STATUS_SUCCESS; } static void |