From 1b4b361a920081d1fcb8b1e0a24bb9a6b4e08789 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Thu, 27 Oct 2016 19:08:08 +0200 Subject: [PATCH] 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 --- .../native/meta-input-settings-native.c | 18 ++++-------------- 1 file 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