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 */