mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-26 15:40:06 +01:00
Allow for a 0 button on button scrolling
This effectively disables the button scrolling, but since 0 is the default button for most devices, we should allow setting the default button. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
617bab3731
commit
c7bf6fb0e2
2 changed files with 3 additions and 1 deletions
|
|
@ -1591,7 +1591,7 @@ libinput_device_config_scroll_set_button(struct libinput_device *device,
|
|||
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) == 0)
|
||||
return LIBINPUT_CONFIG_STATUS_UNSUPPORTED;
|
||||
|
||||
if (!libinput_device_has_button(device, button))
|
||||
if (button && !libinput_device_has_button(device, button))
|
||||
return LIBINPUT_CONFIG_STATUS_INVALID;
|
||||
|
||||
return device->config.scroll_mode->set_button(device, button);
|
||||
|
|
|
|||
|
|
@ -2169,6 +2169,8 @@ libinput_device_config_scroll_get_default_mode(struct libinput_device *device);
|
|||
* @note Setting the button does not change the scroll mode. To change the
|
||||
* scroll mode call libinput_device_config_scroll_set_mode().
|
||||
*
|
||||
* If the button is 0, button scrolling is effectively disabled.
|
||||
*
|
||||
* @param device The device to configure
|
||||
* @param button The button which when pressed switches to sending scroll events
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue