Commit graph

3878 commits

Author SHA1 Message Date
Peter Hutterer
8e4d820efd test: only run the speed finger tests when the touchpad has thumb detection 2019-07-15 13:08:47 +10:00
Peter Hutterer
181f8d2ab5 test: only run the speed tests for clickpads
We don't need speed detection for non-clickpads - the only reason to ever drop
a second finger on those is to either scroll or trigger a gesture. Unlike
clickpads, where a dropped finger may be a thumb to click.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
f140826c86 touchpad: only log edge scroll state changes when the state actually changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
282979558e touchpad: add a helper function for supressing a thumb
Only sets the state to YES at the moment, will do more in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Matt Mayfield
15c8613a65 gestures: Improve thumb detection, allow one finger scroll
Check if there's a thumb if we have two touches. If one finger moves but
the thumb remains still, we assume that one is really a thumb. But if the
thumb moves while the finger is still, let's assume this is a 2-finger scroll.

Extracted from Matt Mayfield's thumb detection patchset
2019-07-15 13:08:47 +10:00
Peter Hutterer
1dae79c833 gestures: fast-track scroll/swipe detection when gestures are off
We can't detect pinch when gestures are off anyway, so we don't need to check
the finger distances.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Matt Mayfield
93ab2f964a gestures: improvements to pinch detection
Only bias towards scrolling if the fingers are in the position past the
timeout.
2019-07-15 13:08:47 +10:00
Matt Mayfield
e97f054917 gestures: improve scroll responsiveness for vertically aligned touches
Put some basic location checks in, if the fingers are next to each other and
vertically close, assume scroll over swipe.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>:
2019-07-15 13:08:47 +10:00
Matt Mayfield
7b9a6a94a3 touchpad: basic thumb detection within gestures
When a touchpad has thumb detection enabled, avoid false-positive gestures
involving a resting thumb by using two thresholds: inner and outer.

While both touches remain inside their inner thresholds, remain in UNKNOWN
state to allow for accurate gesture detection even with no timeout.

If both touches move outside their inner thresholds, start a pinch or
swipe/scroll gesture according to direction, as usual.

If one touch moves outside its outer threshold while the other has not yet
exceeded its inner threshold, and thumb detection is enabled, then if one
touch is >20mm lower, mark it as a thumb and cancel the gesture.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
7fbfb14419 touchpad: rename the thumb detection methods
No functional changes, just prep work for a later patch where the thumbs will
dynamically update their state (instead of just using yes/no/maybe).

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
47d8f05d3b touchpad: extract some bits of thumb detection into helper functions
No functional changes

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
93a754c41c touchpad: move the speed-thumb detection code to the thumb helper file
Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
117ef65087 touchpad: add helper function to reset a thumb's state
Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
c2331ae11e touchpad: explicitly start with detect_thumbs as false
Not needed because we zalloc() anyway, but this makes it grep-able.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
d232e44c9f touchpad: add helper function for setting the thumb state
This moves the thumb state logging directly into that helper function too.

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
9e27244e6c touchpad: move tp_init_thumb and tp_thumb_detect to the thumb file
Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
7c9ed03c42 touchpad: add a helper function for counting touches for gestures
Currently the same as tp_touch_active() but this will change.

No functional changes.

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
6e27a100b5 touchpad: add a helper function for checking thumb state
No functional changes

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
7e89e43c74 touchpad: rename the scroll timeout define, drop the pinch one
The previously 'scroll'-named timeout is also used for swipe, so let's rename
it. And the pinch one isn't used at all.

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
43b910b1df touchpad: reduce state debugging output by only logging changed states
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
f1873fae62 doc/user: fix a typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-10 14:44:23 +10:00
Peter Hutterer
7b9affcf4b meson: run the test suite per group
We can't run this in parallel so it doesn't gain us any speed advantage. If
anything, it'll be slower because it's more setup time in between. But: meson
doesn't display the result until the test suite finished, so having this
broken up into smaller chunks means we're more likely to see a general failure
early.

And the failure should be quicker to reproduce as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 13:46:20 +10:00
Peter Hutterer
47cf7e0995 test: use the default job control for --filter-groups
All filter arguments currently force a -j1 unless otherwise specified. Change
this for --filter-group since that one is most likely invoked by some test
setup that can either add -j X or set the environment variable LITEST_JOBS as
well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 13:28:47 +10:00
Peter Hutterer
63e7942008 meson.build: move the leftover udev rule check up
ninja executes the test in the same order but we don't want to waste 5 minutes
testing other things when we have a udev rule leftover from a previous run.

Plus, this test can't be run in parallel with others, so in the worst case we
had to wait for several long-running tests to finish before this one could be
started.

To avoid all this, let's move this up to be the first check.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 13:25:32 +10:00
Peter Hutterer
734ada5e94 test: fix an always-true check for udev properties
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 09:53:49 +10:00
Peter Hutterer
cc908b68a9 test: fix two coverity warnings
Alleged division by zero and use of an uninitialized variable. Both cannot
happen the way we call the tests, so let's just abort to make coverity happy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 09:47:31 +10:00
Peter Hutterer
6f6a9d95d5 test: drop the litest feature enum, make it normal bits instead
The coverity compiler can't handle 64-bit enums and since it does provide
useful data, let's switch this to #defines instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 09:44:12 +10:00
pixl
cc370f53c4 Fixed a grammar error 2019-07-05 05:14:31 +00:00
Peter Hutterer
345846729c test: one O_NONBLOCK is enough
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-01 12:18:13 +10:00
Peter Hutterer
d1af333546 quirks: add touchpad range for cypress touchpads
As found in the Dell XPS 12 9Q23

Fixes #310

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-28 11:27:13 +10:00
Peter Hutterer
ffa487fac3 quirks: rename the cyapa quirks file to cypress
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-27 11:20:05 +10:00
Peter Hutterer
8d3788fa8c evdev: when the kernel fuzz is nonzero, set ours to zero
Our udev callout is supposed to reset the kernel fuzz to 0 and move the value
to the LIBINPUT_FUZZ property. This is to stop the kernel from applying its
own hysteresis-like approach.

Where the kernel fuzz is nonzero, something has gone wrong with that approach.
Complain about it and set our fuzz to zero, we are in the hands of the kernel
now. If we leave our fuzz as nonzero, we'll apply our own hysteresis on top of
the kernel's and that leads to unresponsive behavior.

Fixes #313

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-27 11:17:28 +10:00
Peter Hutterer
aa538dc5c8 meson: force litest to use the right udev rules
We generate litest-specific udev rules that contain the path to the binaries
in the builddir. But litest wasn't using those, so IMPORT would run things in
/usr/lib/udev instead. Thus any changes to those binaries generated false test
results depending on how compatible the system-installed libinput was.

This is why 410b157 passed the test suite for example.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-27 11:17:28 +10:00
Peter Hutterer
6a489b0636 tools: return 77 if gtk_init() fails in the debug-gui
And when that happens, skip the tests because what's happening here is that
you're running tests as root, but your X server doesn't allow root to connect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 21:09:22 +10:00
Peter Hutterer
523c82abb5 meson: increase the test time for the selftest suite
Because it's timing out on the XPS

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 21:07:24 +10:00
Peter Hutterer
61553432b0 test: disable coredumps for the selftest
Because on my XPS coredumps take away all the CPU, leading to a test timeout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 21:07:21 +10:00
Peter Hutterer
82958a31f1 evdev: only extract the fuzz for touchpads and touchscreens
We don't have a hysteresis for tablet devices, so let's leave those as-is.

This may be a slight regression in behavior compared to pre-410b157e84 now the
kernel will apply the fuzz. Let's see if anyone notices, the fuzz is usually
so tiny on tablets that it shouldn't be noticable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 18:27:36 +10:00
Peter Hutterer
82102f8599 If we never initialized the libwacom database, don't check the refcount
If the libwacom context failed to initialize for some reason, the database is
NULL and the refcount remains at zero. Calling unref should just work then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 14:15:09 +10:00
Peter Hutterer
b12084ef76 tools: skip debug-gui option testing if the debug-gui is disabled
Fixes #311

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 03:23:55 +00:00
Peter Hutterer
1f59f06266 udev: only change the fuzz on touchpads and touchscreens (v2)
If we don't handle a device, don't touch it. Especially joysticks that we
don't handle and thus should not touch either.

Related to !231

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 12:21:33 +10:00
Peter Hutterer
e65392c2f5 udev: rename libinput-model-quirks rules to libinput-fuzz-override.rules
Because these days, that's all it does

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 12:21:17 +10:00
Peter Hutterer
d6c075030d Revert "udev: only change the fuzz on touchpads and touchscreens"
This causes a regression - the ID_INPUT_* properties are not available through
libudev within a callout, the device we get here basically has no properties.

Reverts !231

This reverts commit 410b157e84.
2019-06-26 11:21:58 +10:00
Peter Hutterer
34afe3ba1c tools: improve the error messages for measure touch-size/touchpad-pressure
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-24 12:50:08 +10:00
Peter Hutterer
3f557f7246 doc: note that libinput measure is a separate package
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-24 12:50:08 +10:00
Peter Hutterer
015af5f3dc test: fix the slot swap test again
The previous movement was one finger still, the second finger moving. This may
cause axis events to trigger when a 2fg scroll gesture was detected. Those
axis events will stop after the gesture timeout but generate one more axis
stop event.

Make two changes here: first, move the fingers like a proper 2fg scroll
motion. And shuffle around the litest_drain_events() calls to ignore any axis
event immediately after the timeout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-24 12:30:05 +10:00
Peter Hutterer
1796fd92e7 test: avoid a pointer jump when testing for the slot continuation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
8b4c040bfb test: fix the slot swap test
This test worked because no gesture was detected in the initial movement.
If that happens though, releasing one finger triggers the gesture timeout
during which we suppress events, thus failing the test. Fix this by moving,
waiting, moving - that will definitely generate an event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
8f8ad0e31b test: use an enum for the cardinals
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
996270d1a1 test: fix button area scroll test to not be a pinch
Second finger's x coordinate was wrong. That we didn't pick this up as pinch
is quite telling too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
160d3f2b66 test: move the fingers closer together for the empty-slot test
If we're testing for this, let's not try to get it picked up as pinch
gestures. Only an issue on the wacom and magic trackpads because of their
physical size.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00