From 586ac7c4300dfec114a7f8a6f4288b2a2fdef64f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 15 Apr 2015 10:21:47 +1000 Subject: [PATCH] Return INVALID before UNSUPPORTED for click methods All other config options already follow this behavior. Signed-off-by: Peter Hutterer --- src/libinput.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libinput.c b/src/libinput.c index bcb2509d..980b44a6 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -1929,9 +1929,6 @@ LIBINPUT_EXPORT enum libinput_config_status libinput_device_config_click_set_method(struct libinput_device *device, enum libinput_config_click_method method) { - if ((libinput_device_config_click_get_methods(device) & method) != method) - return LIBINPUT_CONFIG_STATUS_UNSUPPORTED; - /* Check method is a single valid method */ switch (method) { case LIBINPUT_CONFIG_CLICK_METHOD_NONE: @@ -1942,6 +1939,9 @@ libinput_device_config_click_set_method(struct libinput_device *device, return LIBINPUT_CONFIG_STATUS_INVALID; } + if ((libinput_device_config_click_get_methods(device) & method) != method) + return LIBINPUT_CONFIG_STATUS_UNSUPPORTED; + if (device->config.click_method) return device->config.click_method->set_method(device, method); else /* method must be _NONE to get here */