Commit graph

2155 commits

Author SHA1 Message Date
Peter Hutterer
a43042425e test: add a helper function to compare the event type
New error message prints the human-readable event type, not just the enum
values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-26 14:12:44 +10:00
Peter Hutterer
bb93f9fd93 tablet: fix minor coding style issue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-26 14:12:44 +10:00
Peter Hutterer
b1a811ee52 touchpad: reset the edge scroll state on touch up if edge scroll is disabled
If a touch was down (and up again) before the device was switched to edge
scrolling, libinput reported an error message:
  litest error: libinput bug: unexpected scroll event 0 in area state

While edge scrolling was disabled, any new touch would be set to the area
state but it was never reset on touch release.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-23 07:07:55 +10:00
Peter Hutterer
b02acd346b Read the horizontal wheel click angle property if available
The Logitech MX master has different click angles for the two wheels.

https://github.com/systemd/systemd/issues/3947

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-22 11:29:35 +10:00
Peter Hutterer
3cb60130c1 touchpad: on a non-clickpad, reset the motion history on nfingers change
The only reason to have more than one finger on a non-clickpad is to tap,
scroll or gesture. In all cases resetting the motion history is a good idea to
avoid jumps moving from 2 to 1 finger.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-19 10:45:07 +10:00
Peter Hutterer
60c8b07695 doc: fix wrong argument to udevadm hwdb
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-18 15:34:29 +10:00
Peter Hutterer
ff1347727e test: implement tests for configurable tap button mappings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-15 09:09:38 +10:00
Peter Hutterer
fbadb1ad3e touchpad: implement configurable button mapping for tapping
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-15 09:05:57 +10:00
Peter Hutterer
59fac8e902 Add configurable button map to tappings
The previously hardcoded button map for tapping is 1/2/3 to LRM. But the
middle button is a common feature on the desktop (used for paste, most
prominently) and three-finger tapping is almost impossible to do reliably on
some touchpads (e.g. the T440 has a recognition rate of ~1 in 5).

Left and right buttons have a prominent physical position (either softbuttons
or physical buttons) so make the tap order configurable. Those that require
middle buttons reliably can use the [software] buttons for left/right and
2-finger tap for a middle button.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-15 09:05:57 +10:00
Peter Hutterer
a1863b6db8 doc: split middle button emulation into a separate page
Easier to link to from bug reports

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-15 08:02:37 +10:00
Peter Hutterer
d48cee051e evdev: rename all fallback-specific functions to a fallback_ prefix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
acf1c36f83 evdev: pass the dispatch interface around
The only places we should typecast from device->dispatch is where we have
external entry points. Everywhere else keep the pointer to the dispatch
interface we already have anyway.

This way we avoid papering over a potential re-use of a function from
non-evdev code, passing in the wrong dispatch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
bb37a2e102 evdev: move the abs point into the fallback dispatch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
5af236a022 evdev: switch three ints to booleans
And a minor rename to make it more obvious

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
4b94fc6273 evdev: reshuffle the evdev_device struct fields
Have the ungrouped items at the top of the struct for better visibility.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
aac42ca528 evdev: split evdev_dispatch and fallback_dispatch into separate entities
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
0a27faec78 evdev: move the keyboard mask into the fallback dispatch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
dd727ce4fd evdev: move pending_event to the evdev_dispatch struct
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
7e18ef2913 evdev: move the relative deltas for normal devices to the fallback dispatch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
4182e51403 evdev: move the mt struct into the evdev dispatch struct
This is only used by the fallback dispatch method, not by any of the others.
Anything dispatch-specific should go into that struct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
ad031733f2 evdev: move axis dimension handling into a single helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
2469adc852 evdev: split out slot init
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
3013fc6223 evdev: return the dispatch method from evdev_configure_device
Rather than setting a magic device field and returning true/false just return
the dispatch method.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
f89a79d9a4 evdev: move the fallback dispatch creation to evdev_configure_device
All the other devices are created in there too, unify that approach.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-11 19:56:16 +10:00
Peter Hutterer
96b3489f23 Merge branch 'wip/litest-serial-parallel-v3' 2016-08-09 11:18:27 +10:00
Peter Hutterer
e0b36d6da5 doc: add build instructions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-09 10:40:44 +10:00
Peter Hutterer
ae30353a73 doc: add some info about configuring devices in wayland/xorg
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-05 11:14:17 +10:00
Peter Hutterer
a5450e99de gestures: reduce the 2fg scroll timeout to 150ms
This timeout is there to switch to scrolling when the fingers rest on the
touchpad unmoving and thus avoids the initial scroll threshold for slow
scrolls.

Since the only other gestures we support are swipe (usually a fast movement)
and pinch-and-rotate (also a fast movement) we can drop the timeout down
significantly and thus make the scroll feel more reactive.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-05 07:35:30 +10:00
Peter Hutterer
1ea9fbfd4c touchpad: ignore modifier key combos for dwt
Inspired by the syndaemon -K switch and Anton Lindqvist's patch.
https://patchwork.freedesktop.org/patch/102417/

We already ignored modifiers for dwt. Now we also ignore modifier + key
combinations, i.e. hitting Ctrl+s to save does not trigger dwt, the touchpad
remains immediately usable.

However, if dwt is already active and a modifier combination is pressed, dwt
remains active, i.e. while typing, a shift + key does not disable dwt.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-05 07:35:10 +10:00
Peter Hutterer
114021a6c1 test: add dwt modifier/fkey test cases
dwt shouldn't trigger on those keys

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-04 12:57:02 +10:00
Peter Hutterer
8a8c72983f udev: check wacom devices for a paired product id
The newer Wacom Cintiqs have touch devices with a different PID than the pen
device. Use the new libwacom_get_paired_device call where available to pair
the two devices and give them the same device group.

This isn't that important just yet, so no need to force users to update to a
new libwacom version.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-08-03 14:06:48 +10:00
Peter Hutterer
90f6e43562 Include config.h from libinput-util.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 14:24:12 +10:00
Peter Hutterer
00ceff3245 test: just use litest_add_device if we don't have overrides
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 14:24:04 +10:00
Peter Hutterer
3b0956aae3 evdev: fix typo "device device"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 14:23:55 +10:00
Peter Hutterer
6cde53fc1d test: if we're in a debugger, use single-fork mode only
Don't fork by default if we're in gdb.

Note that is_debugger_attached() is now inside #ifndef LITEST_NO_MAIN, gdb for
the litest selftest will now require a manual CK_FORK=no.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:32:03 +10:00
Peter Hutterer
681f967c8f test: if a filter is specified, don't parallelize jobs by default
Likely testing a specific set of tests, possibly in gdb. So don't parallelize.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:32:03 +10:00
Peter Hutterer
13a88a762c test: split the tap tests into more tap groups
We're grouping by test suites, so split up the suites a bit further. The tap
tests all have timeouts and thus take forever, splitting them across multiple
forks means we can finish the test suite quicker.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:32:03 +10:00
Peter Hutterer
152fe5fc5f test: remove NOTPARALLEL
We only have a single test runner now, so no need to restrict it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:32:02 +10:00
Peter Hutterer
eb8e1d4a13 test: add a make-like job control to run tests in parallel
Add a make-like -j/--jobs option to split the number of parallel test
processes. Defaults to 8 if not specified, future patches will default this to
1 for special cases where filters are specified or gdb is detected.

Each subprocess overwrites argv[0] to be easier identifiable in the ps
output when we're trying to figure out which tests are still running.

A -j1 is equivalent to the previous functionality, i.e. we don't fork.

One quirk needed for check: any test case not part of a test runner will not
be freed and thus triggers valgrind. We do test filtering by splitting
up the tests across multiple forks (i.e. each process has several tests that
are in the list but not added to the runner). Thus we need to mark those we
expect check to free as used.
Then on cleanup we traverse the test list, add all the unused one to a
test runner and free that test runner (without actually running it). This
cleans up both the filtered tests in each subprocess and the whole test list
in the parent process which doesn't run a test itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 11:26:58 +10:00
Peter Hutterer
1d5c1fedb4 test: drop the sysname comparison in the device add/remove test
Running tests in parallel virtually guarantees a different device is added in
between. What we're testing here is that the device comes back and the
original ref doesn't send events, so a false test failure would still indicate
a bug anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
68841bfd52 Revert "test: create a lock file to avoid parallel udev reloads during device add"
Not needed anymore, we only have one process creating the udev rules.

This reverts commit 030ec053fb.
2016-08-02 10:19:38 +10:00
Peter Hutterer
51fb42cb60 test: restore the hwdb/udev rules on SIGINT
We can't call system() in the signal handler but we are allowed to fork. Do
that, update the hwdb and immediately exit the child again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
f9f4bb0266 test: make sure we remove all udev rules when we SIGINT the test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
a7f04c9a84 test: only init the device rules once
The udev hwdb takes about 200ms and we still trigger it on each device. The
udev rules don't actually change after compiling, so simply create them
once and remove them after the test run.

For multiple test binaries this needed to be synchronized (which is hard),
hence the previous merge into a single binary for all tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
35b28b1af3 test: merge all tests into a single binary
Call it a libinput-test-suite-runner, in subsequent patches we'll handle doing
parallel tests ourselves instead of relying on automake features.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
bc76bd6f77 test: store created udev rules in a list for easier deletion
Easier to clean up than knowing all the destination paths we'll install.
Only affects global udev rules so far.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 14:49:45 +10:00
Peter Hutterer
c4a21a4e9e test: make the valgrind test an actual dependency of the test run
With parallel builds the valgrind test run would run at the same time as the
normal run, the test suite isn't designed for that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 14:49:45 +10:00
Peter Hutterer
64e3941189 touchpad: use the udev ID_INPUT_TOUCHPAD_INTEGRATION property if available
udev now labels touchpads as "internal" or "external" for us, use that value
where available and only fall back onto our own labelling if it's missing or
unknown.

systemd commit: https://github.com/systemd/systemd/pull/3638

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 14:33:35 +10:00
Peter Hutterer
14d0cd9d38 doc: add links to the two debugging tools as examples
These are the simplest examples on how to use libinput and should be enough to
get any potential user started.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 13:53:22 +10:00
Peter Hutterer
5c03500d8e test: make the interfaces static
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-01 12:23:08 +10:00