diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-04-14 15:35:07 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-04-21 00:15:42 +0000 |
commit | a37d6dcc9c2ec7ebd0d3609e01da1cfcec28db6e (patch) | |
tree | 68cd76668a4a53e0b6fca7991cf092138cfc2032 /test/test-touchpad-buttons.c | |
parent | 467266bbb4cd208ecf163a6461bad1e47b5e6872 (diff) | |
download | libinput-a37d6dcc9c2ec7ebd0d3609e01da1cfcec28db6e.tar.gz |
touchpad: if we have a right button, let's assume it's not a clickpad
This assumption dates back roughly a decade when INPUT_PROP_BUTTONPAD was
introduced into the kernel. To my knowledge, devices right now erroneously
advertise INPUT_PROP_BUTTONPAD when they are not a clickpad (but then they
have BTN_RIGHT) or they lack INPUT_PROP_BUTTONPAD (and only have BTN_LEFT).
So let's change our assumption here - if a clickpad has a right button log the
kernel bug and continue with the assumption the device is a touchpad with
physical buttons.
To disable that warning, fix the kernel or add an AttrInputPropDisable quirk
for the device.
Fixes #595
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test/test-touchpad-buttons.c')
-rw-r--r-- | test/test-touchpad-buttons.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test-touchpad-buttons.c b/test/test-touchpad-buttons.c index 6af571d9..e55da5c1 100644 --- a/test/test-touchpad-buttons.c +++ b/test/test-touchpad-buttons.c @@ -2098,6 +2098,29 @@ START_TEST(touchpad_non_clickpad_detection) } END_TEST +START_TEST(touchpad_clickpad_detection) +{ + struct litest_device *dev; + uint32_t methods; + int codes[] = { + INPUT_PROP_MAX, INPUT_PROP_BUTTONPAD, + -1, -1, + }; + + /* Create a device with LR buttons and INPUT_PROP_BUTTONPAD set - we + * should ignore the property and assume it's a non-clickpad. + * Only way to check that is to verify no click methods are set. + */ + dev = litest_create_device_with_overrides(LITEST_SYNAPTICS_TOUCHPAD, + "litest Fake Clickpad", + NULL, NULL, codes); + + methods = libinput_device_config_click_get_methods(dev->libinput_device); + ck_assert(methods == 0); + litest_delete_device(dev); +} +END_TEST + TEST_COLLECTION(touchpad_buttons) { struct range finger_count = {1, 4}; @@ -2168,5 +2191,6 @@ TEST_COLLECTION(touchpad_buttons) litest_add(clickpad_middleemulation_click_enable_while_down, LITEST_CLICKPAD, LITEST_ANY); litest_add(clickpad_middleemulation_click_disable_while_down, LITEST_CLICKPAD, LITEST_ANY); + litest_add_no_device(touchpad_clickpad_detection); litest_add_no_device(touchpad_non_clickpad_detection); } |