Commit graph

71 commits

Author SHA1 Message Date
Peter Hutterer
91cbe7a11d test: drop an unnecessary wait for event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-19 13:28:38 +10:00
Peter Hutterer
555ee1a989 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>
2017-04-24 10:27:32 +10:00
Peter Hutterer
c225c0592c evdev: don't provide button scrolling on absolute pointer devices
This may be a feature for the future but for now be honest and don't claim
that button-based scrolling is available, it's not hooked up in the absolute
code path.

https://bugs.freedesktop.org/show_bug.cgi?id=99865

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 21:43:45 +10:00
Peter Hutterer
6a2870f5ca evdev: add "READY" state to button scrolling
Before, our states were idle, button down and scrolling. This adds a state
where the button is down and the timeout has expired (i.e. we're ready to send
scroll events) but we haven't actually sent any events anymore.

If the button is released in this state, we generate a normal click event.

https://bugs.freedesktop.org/show_bug.cgi?id=99666

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 21:16:34 +10:00
Peter Hutterer
bcf8c222cb test: add tests for middle button + button scrolling on BTN_LEFT
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 13:51:37 +10:00
Peter Hutterer
f7f849e576 evdev: add quirk for Logitech Marble Mouse
Device needs BTN_MIDDLE disabled, this way middle button emulation is present
by default.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:25:05 +10:00
Peter Hutterer
53e263fce7 test: fix the pointer scroll-defaults test
The button-scroll by default behavior is only true on devices with a middle
button.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:17:26 +10:00
Peter Hutterer
72c5821a3b test: skip two tests when middle button is missing
And disable middle button emulation for this test, it would mess with the test
results.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:17:22 +10:00
Peter Hutterer
9ab05b0bfd test: fix middle button defaults test
This failed on devices without a middle button, we just didn't have a test
device to trigger this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:17:05 +10:00
Peter Hutterer
42b68397f9 test: check the libinput device for BTN_MIDDLE, not the libevdev device
We don't have the same libevdev context that libinput has so if libinput
disables/enables event codes we don't see that and may get unexpected
behavior in the test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:16:02 +10:00
Peter Hutterer
be30b28a12 Merge branch 'gcov-tests'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 12:27:39 +10:00
Peter Hutterer
f2f616a1fc touchpad: mark the Apple onebutton touchpad as clickfinger-default
We don't initialize click methods on devices with physical buttons. This model
is a special case, it's not a clickpad but it only has one button (because one
button is all you ever need and whatnot).

https://bugs.freedesktop.org/show_bug.cgi?id=99283

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 09:26:07 +10:00
Peter Hutterer
6d8a256bd4 Swap the return values for unsupported scroll button configs
Usually we reply INVALID before we reply UNSUPPORTED but that's only for those
values where the value is a programming error. But in this case it's a bit
more complicated. INVALID is only for the cases where the button doesn't exist
on the device, if we don't have button scrolling at all then we have
UNSUPPORTED for all.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 11:23:18 +10:00
Peter Hutterer
7735f3aa4e test: add test for setting pointer accel profiles on no-accel devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 11:06:48 +10:00
Peter Hutterer
a7720d3625 test: add test for natural scroll defaults on no-scroll devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 10:48:13 +10:00
Peter Hutterer
65c4b27260 test: fail before zero division
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-01 13:12:57 +10:00
Peter Hutterer
ebeba8e8ff Merge branch 'wip/wheel-tilt-source' 2017-01-20 12:51:53 +10:00
Peter Hutterer
0d09791afb test: add test for fetching invalid pointer axes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
66d12ac8ff test: add tests for checking for buttons for a non-pointer device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
4d20130e05 test: fix pointer accel defaults test
Loop immediately exited, this code was never triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
5d66edc9f4 test: prefix all test source files with "test-"
They weren't originally prefixed but the various tests were, but now that we
only have one test runner binary anyway, the prefix helps sorting the files
easily within e.g. gcov results.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:00 +10:00
Renamed from test/pointer.c (Browse further)