summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2016-10-27 19:08:08 +0200
committerRui Matos <tiagomatos@gmail.com>2016-11-02 14:06:39 +0100
commit1b4b361a920081d1fcb8b1e0a24bb9a6b4e08789 (patch)
tree16dc1705bb7ae0db20d90eb3cf888f8e592aac68
parent6054b1cdbd22dbcb5498d635aa3d6f1bf5f53c04 (diff)
downloadmutter-1b4b361a920081d1fcb8b1e0a24bb9a6b4e08789.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
-rw-r--r--src/backends/native/meta-input-settings-native.c18
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