Commit graph

3791 commits

Author SHA1 Message Date
Peter Hutterer
90216a010a path: drop the separate header, not necessary
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-11 15:49:02 +10:00
Peter Hutterer
8a15c404f9 test: abort if our device didn't initialize
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-11 15:49:02 +10:00
Peter Hutterer
164a6a8159 test: fix an intermitted failing test
The touchpad_2fg_scroll_initially_diagonal test would semi-reliably fail under
valgrind but succeed otherwise. Cause was that on some devices, the initial
diagonal movement wasn't diagonal enough and closer to a horizontal movement.
This was fine on normal runs, but under valgrind we'd hit the "active
threshold" time limit and lock to horizontal scrolling, ditching the remaining
events and failing the test.

Fix this by calculating the scroll vector based on the device's width/height
ratio and go "more diagonal" on the initial vector.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-11 15:49:02 +10:00
Zach Moazeni
383a60abea Better Thinkpad T480 trackpoint multiplier 2019-06-07 01:20:44 +00:00
Peter Hutterer
410b157e84 udev: only change the fuzz on touchpads and touchscreens
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-07 01:16:05 +00:00
Peter Hutterer
bf4277623f Add a new dispatch interface for the Dell Canvas Totem
This device looks similar to a MT device on the kernel side, but it's not a
MT device and it's not quite a tablet either. It uses slots to track up to 4
totems off the same device and the only hint that it's not a MT device is that
it sends ABS_MT_TOOL_TYPE / MT_TOOL_DIAL.

udev thinks it's a touchscreen and a tablet but we currently init those
devices as touchscreen (because all wacom tablet touch devices are udev
tablets+tochscreens). So we need a quirk to hook onto this device.

And we use a completely separate dispatch implementation, because adding the
behavior to the tablet interface requires so many exceptions that it's easier
to just add a separate dispatch interface.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-07 01:03:21 +00:00
Peter Hutterer
17d792445e tablet: add a the Totem tool type to the tablet interface
This is the public API only, not the internal bits, so nothing will work just
yet.

This interface addition is for the Dell Canvas Totem tool, so let's go with
the same name because options like "Rotary" are too ambiguous.

The totem is a knob that can be placed on the surface, it provides us with
location and rotation data. The touch major/minor fields are filled in by the
current totem, but they're always the same size.

The totem exports BTN_0 as well, so let's add that to the debug-events output.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-07 01:03:21 +00:00
Peter Hutterer
52e86f4b2a test: force the litest feature enum to be 8 bytes or more
We've used up all bits, so let's extend the enum. (1 << 31) triggers an
assertion because we check for > LITEST_DEVICELESS. So we can't use that bit
without other changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-07 01:03:21 +00:00
Peter Hutterer
fe47232949 doc/api: more CSS styling 2019-06-05 13:03:11 +10:00
René Genz
58ce4960e4 doc/user: fix some typos 2019-06-04 01:44:38 +00:00
Peter Hutterer
c9a936f1bb test: drop two unreachable statements
This was a copy-paste error in the form of

	while(event) {
	   ...}
	} while(event);

Found by coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-03 10:10:40 +10:00
Peter Hutterer
3b0f068eaf Warn if NDEBUG is defined
We rely on assert() too much for safety checks, let's not let the user disable
it without warning

Fixes #262

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-28 14:10:54 +10:00
Peter Hutterer
8dfe8c68eb quirks: add trackpoint integration attribute
Some versions [1] of the Lenovo ThinkPad Compact USB Keyboard with TrackPoint USB
have the pointing stick on an event node that has keys but is not a regular
keyboard. Thus the stick falls through the cracks and gets disabled on tablet
mode switch. Instead of adding more hacks let's do this properly: tag the
pointing stick as external and have the code in place to deal with that.

[1] This may be caused by recent kernel changes

Fixes #291

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-28 13:23:49 +10:00
Peter Hutterer
3dc27d5d38 test: add a missing blank line 2019-05-28 13:23:49 +10:00
Peter Hutterer
5e3c45780f quirks: handle ID_INPUT_KEY as udev keyboard match
We handle that as keyboard in the evdev code, let's do so here as well.

Related to #291

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-28 12:55:17 +10:00
Peter Hutterer
b3a7f22ae2 gitlab CI: switch F29 special builds to F30
Let's test all these on the most recent version

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-28 10:34:52 +10:00
Peter Hutterer
7147d5a211 test: don't treat a signal exit as success
WEXITSTATUS() "should be employed only if WIFEXITED returned true", see
wait(2). If a test failed with an abort, WIFEXITED is false and WEXITSTATUS
is... undefined? and apparently zero, so test case failures would cause a
false postive test result.

This doesn't affect a normal test run because check handles the aborts
correctly, but the valgrind invocation with CK_FORK ended up being handle by
litest. So with the result that any abort during valgrind was a silent success
and if there was a memleak in the same process that exited with a signal, the
memleak would be ignored too.

Fixes #267

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-28 10:32:08 +10:00
Peter Hutterer
ee1bc318d5 Abstract libwacom database initialization into a single place
No real changes for the non-tablet code, but for tablets we now keep the
libwacom datbase around. The primary motivating factor here is response time
during tests - initializing the database under valgrind took longer than the
proximity timeouts and caused random test case failures when a proximity out
was triggered before we even got to process the first event.

This is unfortunately a burden on the runtime now since we keep libwacom
around whenever a tablet is connected. Not much of an impact though, I
suspect, chances are you're running a web browser and everything pales against
that anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-28 10:32:08 +10:00
Peter Hutterer
9b414faea2 test: allow for a LITEST_JOBS environment variable
valgrind struggles with too many parallel jobs, too easy to hit timeouts.
Let's reduce this for the valgrind runs.

Meson doesn't let us pass arguments through depending on the setup, so let's
make this an environment value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-28 10:23:25 +10:00
Peter Hutterer
fe8a0eee3f test: make all tap tests use the "tap" group prefix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 21:02:33 +10:00
Peter Hutterer
d2cce8298d test: always set CK_FORK=no under valgrind
Set this in the code rather than the environment variable to make it easier to
run valgrind manually.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 21:02:33 +10:00
Peter Hutterer
64df646658 test: split a test up into events vs processing
Running under valgrind, this test often fails when the machine is under load.
Split it up so the events are all processed in one go, reducing the chance of
getting a timeout while processing a previous event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 21:02:33 +10:00
Peter Hutterer
0a4d59d88d test: add test cases for tablet/touchpad left-handed rotation locks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 13:53:35 +10:00
Peter Hutterer
e8bf179f5d touchpad: lock the touchpad rotation to the tablet rotation
Follow-up to 6229df184e
We must not rely on the caller to toggle the left-handed bits correctly since
they may not know which devices belong together (despite device groups). Let's
do the right thing here, if the tablet is set to left-handed, rotate the
touchpad accordingly.

Note that the left-handed setting of the tablet is left as-is
(right-handed). Until we have notifications about configuration changes, this
is the best we can do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 13:53:35 +10:00
Peter Hutterer
7f4eb8ada1 tablet: lock the tablet rotation to the touchpad rotation
Follow-up to 6229df184e
We must not rely on the caller to toggle the left-handed bits correctly since
they may not know which devices belong together (despite device groups). Let's
do the right thing here, if the touchpad is set to left-handed, rotate the
tablet accordingly.

Note that the left-handed setting of the touchpad is left as-is
(right-handed). Until we have notifications about configuration changes, this
is the best we can do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 13:53:35 +10:00
Peter Hutterer
829673901c tools: add --apply-to to debug-events and debug-gui
All configuration options will only apply to the device with the given match
mattern. This makes it easier to test things like tapping on one device but
not on the other.

Exception is the sendevents pattern which applies independently.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 11:13:48 +10:00
Peter Hutterer
4f63345b60 tablet: don't disable the proximity quirk on good sequences
There are tablets out there that *sometimes* send the right event sequence,
but are generally broken. So let's not disable that quirk even if we do get a
right sequence.

Affected devices: Lenovo Flex 5
Fixes #248
Fixes #290

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 10:16:35 +10:00
Peter Hutterer
8b3aca4ceb test: fix a typo in the test device name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 09:52:04 +10:00
Peter Hutterer
08da56dc81 test: assign ID_INPUT_TABLET to the bamboo/intuos5 touchpad parts
We rely on libwacom to set this, but it doesn't do so by default for uinput
devices. Let's set this here so the parts are correctly detected as tablet
touchpads.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 09:52:04 +10:00
Peter Hutterer
4cd332c92c fallback: make a debug log prefix more consistent
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 09:10:23 +10:00
Peter Hutterer
1e73cccfd9 test: make the test case failure output easier to select
Split the suite and test case name up so it's easier to select with a
double-click in the terminal. Because usually those tests need to be re-run
individually and making that easier is a good thing.

Previously:
:: Failure: ../test/test-tablet.c:4434:touch_arbitration:wacom-cintiq-13hdt-pen-tablet

Now:
:: Failure: ../test/test-tablet.c:4434: touch_arbitration(wacom-cintiq-13hdt-pen-tablet)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-09 13:57:45 +10:00
Peter Hutterer
d5bdf7f232 touchpad: fix two debug messages to have the same prefix as the rest
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-08 14:09:28 +10:00
Peter Hutterer
9802ada606 touchpad: don't check libwacom if we're not tagged as tablet touchpad
No need to go through the effort if we're not tagged as a tablet+touchpad
device anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-08 14:09:28 +10:00
Peter Hutterer
902f1014c8 tablet: add an extra debug message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-08 14:09:28 +10:00
Peter Hutterer
192f063c1f tablet: indentation fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-08 14:09:28 +10:00
Peter Hutterer
632b0f741b test: fix the wacom bamboo touch device
Missing buttons caused it to fail sanity checks in some cases.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-08 14:09:28 +10:00
Peter Hutterer
803a99ac05 test: fix a bunch of tests expecting BTN_TOOL_TRIPLETAP
A device may have 1 or 2 slots without setting BTN_TOOL_TRIPLETAP, those
devices will fail those tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-08 14:09:28 +10:00
Peter Hutterer
cac9d53789 test: drop the SKIP_LIBINPUT_TEST_RUNNER environment variable
We have the meson test suites now that we can use to filter which tests to
run, let's use those.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
291313e7d9 CI: use meson test instead of ninja test
This way we can use the test suites to exclude the ones that won't run on a
container.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
32cd8ae011 test: skip the backtrace under valgrind
gstack can't resolve the backtrace under valgrind anyway, so let's just skip
it altogether.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
2185a9d6bd test: return 77 for skip when we're not running a test
This isn't technically needed since those tests aren't in the valgrind test
suite anymore. But let's have it here anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
01efe9de4f test: replace the USING_VALGRIND env with the valgrind.h header
This header is intended to be included in the project, so let's do that and
have proper runtime detection of the valgrind environment.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
40f3e2603f tools: drop the valgrind check in the option-parsing test
It's not part of the valgrind test suite, so we don't need this check anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
e9cfa513ee meson: group all tests under suite names
Three suite names to allow for filtering tests: 'valgrind', 'root',
'hardware'. The latter two require root/hardware to succeed, the former labels
tests that should be run under valgrind.

Usage is documented in the docs now, but basically:

$ meson test --setup=valgrind --suite=valgrind
$ meson test --no-suite=root

This is documented a bit now and because we now rely on meson test, let's
replace all ninja test invocations with meson test instead for consistency.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
d7b1ebef4b tools: we don't need a core file for failed option parser tests
SIGQUIT which we send to any successful test of libinput debug-event will
trigger a coredump. We don't need that one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
dd96d6b900 Revert "Reduce button scroll timeout to 38ms"
This introduces a regression, see #265. Reverting until a better solution can
be found.

This reverts commit 5dae7aac38.
2019-05-02 10:53:54 +10:00
Peter Hutterer
ce971a1dc9 CI: update Ubuntu from 18.04 to 19.04
Using 18.04 holds back the use of meson test suites in the CI infrastructure
(!216) and it's not likely to get an update to a more recent libinput version
anyway, so let's not bother with it here, even if it is an LTS.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-02 08:46:31 +10:00
Peter Hutterer
c6489e826b CI: switch from Fedora 28 to Fedora 30
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-02 08:36:03 +10:00
Peter Hutterer
c35e0e734f test: update valgrind suppressions for a glib leak
Fixed upstream, but it's not in F30 yet so the valgrind tests fail there.
https://gitlab.gnome.org/GNOME/glib/merge_requests/338

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-01 12:03:38 +10:00
Peter Hutterer
6229df184e touchpad: rotate the touch part of tablets
Tablets in left-handed mode are rotated, so we need to rotate the touchpad
part of them too. This doesn't affect all tablets though, some of them are
symmetrical and the left-handed mode merely changes the button order around
(some of the earlier Bamboos). So we rely on libwacom to tell us which device
must be rotated.

The rotation itself is done on the input coordinate itself as we get it. This
way any software buttons, palm zones, etc. are automatically handled by rest
of the code.

Fixes #274

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-30 16:28:29 +10:00