summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-02-27 11:20:14 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-04-24 10:27:32 +1000
commit555ee1a9898d4c19d138b9a5fe77138abfe47283 (patch)
tree9d4dfe73d5d8e177682acbdff9ffc971f96771ea /test
parent927ad51fad1ad25497d7a2cbc538fcff742d5a6c (diff)
evdev: improve default scroll button detection
Try to guess the default scroll buttons a bit better. Right now we default to scroll button 0 (disabled) whenever a device doesn't have a middle button but we might as well cast a wider net here as setting a scroll button only has a direct effect when button scrolling is enabled. Use the first extra button we find or fall back onto the right button if we don't have any extra buttons. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r--test/test-pointer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test-pointer.c b/test/test-pointer.c
index 06c45b2..e09f8f8 100644
--- a/test/test-pointer.c
+++ b/test/test-pointer.c
@@ -1176,11 +1176,15 @@ START_TEST(pointer_scroll_defaults_logitech_marble)
struct litest_device *dev = litest_current_device();
struct libinput_device *device = dev->libinput_device;
enum libinput_config_scroll_method method;
+ uint32_t button;
method = libinput_device_config_scroll_get_method(device);
ck_assert_int_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL);
method = libinput_device_config_scroll_get_default_method(device);
ck_assert_int_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL);
+
+ button = libinput_device_config_scroll_get_button(device);
+ ck_assert_int_eq(button, BTN_SIDE);
}
END_TEST