Return INVALID before UNSUPPORTED for click methods

All other config options already follow this behavior.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2015-04-15 10:21:47 +10:00
parent bd6fd8bb92
commit 586ac7c430

View file

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