Commit graph

505 commits

Author SHA1 Message Date
Peter Hutterer
9e705bf334 Merge branch 'master' into tablet-support 2015-07-14 13:13:11 +10:00
Peter Hutterer
5bebd4aea4 util: add a helper function to parse a "WIDTHxHEIGHT" property
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-14 10:12:12 +10:00
Peter Hutterer
35fb5412c5 test: remove some excessive linebreaks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 15:41:13 +10:00
Peter Hutterer
cbaa79cfdb test: add an Elantech touchpad device
This is an old recording and predates properties. It's not a clickpad, we
assume INPUT_PROP_POINTER is set.
From: https://bugs.freedesktop.org/attachment.cgi?id=57154

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:28 +10:00
Peter Hutterer
5c76e6f47f test: prefix all test device files with litest-device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:26 +10:00
Peter Hutterer
55435a707f test: add an Apple Magic Trackpad test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:13 +10:00
Peter Hutterer
74a8d6546e test: move finger position to test for right button down
On large touchpads with resolution, 90% of the touchpad may be north of the
button.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:13 +10:00
Peter Hutterer
fa67be9e3c test: reduce movement of finger while pinned
Otherwise the test fails on large touchpads with resolution (magic trackpad).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:09 +10:00
Peter Hutterer
3b419fb17e test: replace hardcoded wacom ID with the #define
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:08 +10:00
Peter Hutterer
3734a67eef test: slow down 2fg slow scroll movement
To avoid test case failures when we switch to forced resolutions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-10 11:43:42 +10:00
Peter Hutterer
cc46e00e81 test: fix memleak in the udev_device_sysname() test
If a device sends other events at startup, those events weren't freed. This
can happen on tablet devices that send proximity events immediately after
DEVICE_ADDED.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-09 16:47:07 +10:00
Peter Hutterer
bfce05db05 test: add test for partial tablet deltas
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-09 15:46:20 +10:00
Peter Hutterer
4e39443757 udev: make sure the udev callout path is valid for a test run
udev requires callout binaries to sit in /lib/udev or otherwise provide an
absolute path. The test suite should work without installing everything first,
so create two rule files - one to install, one with the path to the
$builddir/test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:29:06 +10:00
Peter Hutterer
cc59c8986f test: add touchpad thumb detection tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:27:53 +10:00
Peter Hutterer
4a3288dc59 test: allow for a default value on LITEST_AUTO_ASSIGNS
The touchpads currently all send a default value of 30 for ABS_PRESSURE. For
some tests we want to have a custom pressure but changing all tests isn't
sensible. So hook each device up to send a default value of 30 if it isn't
overridden in the test itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:27:53 +10:00
Peter Hutterer
7d314738fb touchpad: be smarter about clickfinger thumb detection
Watching a colleague try clickfinger right-click after enabling it the first
time showed that the vertical distance is too small. Increase it to 30mm
instead.

Increase the allowed spread between fingers to 40x30mm, but check if one of
the fingers is in the bottom-most 20mm of the touchpad. If that's the case,
and the touchpad is large enough to be feasable for resting a thumb on it,
discard the finger for clickfinger count.

If both fingers are in that area or one finger is in the area and they're
really close together, the fingers count separately and are not regarded as
thumb.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:24:17 +10:00
Peter Hutterer
abff4a1c24 touchpad: allow edge scrolling on clickpads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:24:17 +10:00
Peter Hutterer
77aca3c194 test: add helper function for enabling click methods
Makes the test code easier to read. In tests where we explicitly check the API
the real calls were left in place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:24:17 +10:00
Peter Hutterer
9a8238836e test: move enable_edge_scroll up
No functional changes, just so we can group those helpers together.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:24:17 +10:00
Peter Hutterer
95089b77d4 Merge branch 'master' into tablet-support
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-08 13:50:24 +10:00
Andreas Pokorny
1309718c00 litest: floating point comparison macros
Adds the macros ck_assert_double_{eq,ne,lt,gt,le,ge} to compare double
values using a fixed tolerance value. The tolerance value is
picked based on the range of values to be expected by the libinput API.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-07 17:49:17 +10:00
Andreas Pokorny
2f8703620e litest: add nexus4 style touch screen without orientation
This device provides a circular touch point size and and hence lacks
orientation. It will be used to test default value handling.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-07 17:49:15 +10:00
Andreas Pokorny
ce86418ad0 litest: add a generic multitouch screen
Adds a device with various touch related axes and respective device features
to litest.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-07 17:49:14 +10:00
Andreas Pokorny
e6db46171a litest: add axis_replacement from tablet branch
This change adds strict axis_replacement and litest_touch_move_extended
and litest_touch_down_extended to simulate changes to other axes during
touch down and move events.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-07 17:49:12 +10:00
Peter Hutterer
72ee17f622 Merge branch 'touchpad-gestures' 2015-07-06 14:11:38 +10:00
Hans de Goede
ad26785f6a touchpad: Implement pinch gesture support
Implement touchpad pinch (and rotate) gesture support.

Note that two two-finger scrolling tests are slightly tweaked to assure that
there is enough touch movement to allow the scroll-or-pinch detect code to do
its work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-07-06 14:09:33 +10:00
Hans de Goede
98b1e212ac touchpad: Extend the touchpad gesture API with pinch gestures
Extend the touchpad gesture API with pinch gestures. Note that this
new API offers a single event stream for both pinch and rotate data, this
is deliberate as some applications may be interested in getting both at
the same time. Applications which are only interested in one or the other
can simply ignore the other.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-07-06 14:09:27 +10:00
Hans de Goede
b8a2e5bc5f touchpad: Add an API for touchpad gesture events
For touchscreens we always send raw touch events to the compositor, and the
compositor or application toolkits do gesture recognition. This makes sense
because on a touchscreen which window / widget the touches are over is
important context to know to interpret gestures.

On touchpads however we never send raw events since a touchpad is an absolute
device which primary function is to send pointer motion delta-s, so we always
need to do processing (and a lot of it) on the raw events.

Moreover there is nothing underneath the finger which influences how to
interpret gestures, and there is a lot of touchpad and libinput configuration
specific context necessary for gesture recognition. E.g. is this a clickpad,
and if so are softbuttons or clickfinger used? What is the size of the
softbuttons? Is this a true multi-touch touchpad or a semi multi-touch touchpad
which only gives us a bounding box enclosing the fingers? Etc.

So for touchpads it is better to do gesture processing in libinput, this commit
adds an initial implementation of a Gesture event API which only supports swipe
gestures, other gestures will be added later following the same model wrt,
having clear start and stop events and the number of fingers involved being
fixed once a gesture sequence starts.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-07-06 14:08:54 +10:00
Peter Hutterer
772d69751b Merge branch 'master' into tablet-support 2015-07-06 13:52:57 +10:00
Peter Hutterer
cd6326aa22 test: initialize syspath
When the condition with continue was hit, syspath was still compared in the
loop condition, leading to crashes when strcmp()-ing a random string.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-06 11:38:39 +10:00
Peter Hutterer
2e339095b3 test: add a test for 0/0 relative motion events
This test doesn't really test for that because the kernel shouldn't forward
these events to us in the first place. It's merely a canary to warn us if this
ever changes and we end up not ignoring the events.

The test is only run for one device (the default mouse), no need to waste more
time on this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-03 09:44:04 +10:00
Peter Hutterer
08fba7bd96 test: add a test for minimum motion movement
The first motion on a device must have the mimimum movement factor (0.3)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-03 09:44:04 +10:00
Peter Hutterer
a1feb44836 test: send a single motion event for relative tests only
Since 69449ca854, the minimum deceleration is 0.3 and we don't get a 0 motion
event anymore. We can drop the helper function now too.

What we do in that test instead is pump one relative motion event through
before we start comparing the events, this way our second, third, .. events
will have some acceleration applied and the tests compare more accurate
values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-03 09:44:04 +10:00
Peter Hutterer
261c779f1c test: add some tests for udev tagging
We can't easily test for DMI matches, but anything that hooks onto pid/vid is
easy to verify for correctness.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-03 09:44:04 +10:00
Peter Hutterer
676be4b944 test: use poll instead of a busy wait
Drop the busy loop we had waiting for an event to appear and just call poll on
the libinput fd.

This actually makes the tests more correct, if we now time out where we didn't
before it means we're not setting the timers correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-02 16:10:41 +10:00
Peter Hutterer
97f447d670 test: up the default test timeout to 10s
3s is too easy to hit on congested systems. 10s is overkill, but it's still
better to pass a test late than having to restart the whole test-suite again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-02 16:09:13 +10:00
Peter Hutterer
79b7707d76 test: wait for the uinput_monitor on test devices
Set up a udev_monitor before each device creation and wait for the monitor to
notify us of the newly created device. This should take the place of the
various sleep loops  we currently have sprinkled around the code and provide a
reliability when testing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-02 16:08:56 +10:00
Peter Hutterer
67ebcc3b8a Merge branch 'drop-pointer-normalization' 2015-07-02 13:06:18 +10:00
Peter Hutterer
92e415eadd test: add a low-dpi mouse test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-02 13:03:43 +10:00
Peter Hutterer
a851415c61 test: add the warning to the rules file too
The rules file in /run may be left over after an unclean exit and mess with
things.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-01 11:13:46 +10:00
Peter Hutterer
c0ef2a172a test: increase the udev init timeout
Hitting this limit too often on congested VMs, so let's increase the sleep
sleep (so the system can get done what needs to be done) and get the whole
timeout from 600ms to 2000ms.

Note: if we really hit 2000ms we may still fail on some tests with the check's
default 3 second timeout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-01 08:56:54 +10:00
Peter Hutterer
438ba0fec3 test: group the parser tests together
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-30 13:32:17 +10:00
Peter Hutterer
0e23bc45d9 test: disable pointer wheel tests on tablets
Not implemented yet, not even for tablets with true wheels.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-29 16:03:24 +10:00
Peter Hutterer
ac009c2c20 test: add a waltop tablet test device
Quite similar to wacom tablets but the evdev protocol differs - no serials for
example and only two tools. The device has a wheel, but it's not apparently
part of the stylus like on the wacom tablets. And it has a bunch of keys.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-29 15:39:50 +10:00
Peter Hutterer
6d4dd28979 test: print the missing button's name on test failure
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-29 15:24:50 +10:00
Peter Hutterer
6af06769ad test: skip testing tablet buttons that don't exist on the device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-29 15:24:49 +10:00
Peter Hutterer
9b174fc9d8 test: use the litest macros in the tablet button check
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-29 15:24:49 +10:00
Peter Hutterer
9610ff849e Merge branch 'master' into tablet-support 2015-06-29 13:56:05 +10:00
Peter Hutterer
b344e3e566 touchpad: disable tap drag lock by default
Similar to tapping, it's a feature that is useful but confusing if a user
doesn't know it exists. It makes the touchpad appear laggy and slow to react
in the best case, or appear like a stuck button in the worst case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-29 07:52:41 +10:00
Peter Hutterer
3195b95d1d test: add non-draglock test and rename draglock-dependent tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 14:24:29 +10:00