Commit graph

1165 commits

Author SHA1 Message Date
Peter Hutterer
015151de3a test: move opening { to next line
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-20 13:06:43 +10:00
Peter Hutterer
42fa56c9ee doc: clarify a comment what a "no device" test case means
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-20 13:06:24 +10:00
Peter Hutterer
f70db17d21 Allow disabling of middle button emulation where it doesn't exist
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-19 16:57:49 +10:00
Peter Hutterer
cd163b3b8a Allow disabling tapping on a device without tapping
The doc says this "always succeeds", not "segfaults".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-19 16:57:47 +10:00
Peter Hutterer
120a5b3384 test: add a note to one of the device tests
If we get two different sysnames for the device, this test doesn't test
anything much, so it's better to fail here. But add a comment so that when it
fails it's quite obvious why.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-19 10:58:57 +10:00
Peter Hutterer
d05363316c test: parse the LITEST_VERBOSE environment variable
--verbose only works when running a specific test, sometimes we need make
check to be more verbose. Set this by default for make check, the log becomes
a lot more expressive that way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-19 10:49:49 +10:00
Peter Hutterer
b6eb43b537 path: be more lenient waiting for udev to settle things
Running tests in parallel can exceed the current 100ms max timeout for udev to
settle things. Since this pretty much only triggers in test cases anyway,
let's be more lenient here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-19 10:49:49 +10:00
Peter Hutterer
75fd354aa3 test: drop unneeded includes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-19 10:47:11 +10:00
Peter Hutterer
6acd97457f doc: add some documentation for disable-while-typing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-18 15:16:33 +10:00
Peter Hutterer
c2f8b508b9 touchpad: use a two-stage timeout for disable-while-typing
Hitting a single key triggers a short timeout, just enough to cover the time
to the next key event. Hitting more than one key triggers the longer timeout.

This should improve responsiveness after single key events when the touchpad is
still the main interaction mode and a key needs to be pressed to advance in
the UI. When typing the hands require physical movement to get back to the
touchpad anyway so a longer timeout is acceptable and more reliable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-18 14:39:22 +10:00
Peter Hutterer
d02b670e37 touchpad: add timeout-based disable-while-typing
On some touchpads, typing triggers touches in areas of the touchpad that
cannot easily be distinguished from other fingers. Pressure information is
useless too, so we have to go back to a timeout-based handling of touch data.

If we see non-modifier key events, disable the touchpad for a timeout and set
any touches starting during that timeout as palm.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-18 14:39:22 +10:00
Peter Hutterer
d288eb0a63 touchpad: switch from is_palm to an enum
Preparation to add different palm detection types. Not all of them need to be
un-done when leaving the edge area so a boolean is not enough.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-18 14:39:21 +10:00
Peter Hutterer
46171fbef3 Merge branch 'tap-to-end-drag'
Changed the test merged in to use the new ranged litests functionality

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-18 14:12:12 +10:00
Velimir Lisec
2e0f45b537 test: add test cases for ending drag with a tap
Signed-off-by: Velimir Lisec <lisec.velimir@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-18 14:10:17 +10:00
Velimir Lisec
1ab385bc83 touchpad: end tap-and-drag with an extra tap
Currently for the tap-and-drag gesture to end user has to wait for a
timeout to expire. Make it possible to end the drag gesture by just tapping.

The allowed finger sequences to start and end a drag are thus:
tap, down, .... move ...., up  <wait for timeout>
tap, down, .... move ...., up, tap

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

Signed-off-by: Velimir Lisec <lisec.velimir@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

State diagram changes and a doc change squashed in.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-18 14:10:17 +10:00
Peter Hutterer
217ab899cf timer: fix coverity warning about unused return value
"read(int, void *, size_t)" returns the number of bytes read, but it
is ignored.

We don't really care about the number of bytes, but let's complain if we get
anything but EAGAIN.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-08 14:08:58 +10:00
Peter Hutterer
893fdf9b83 test: switch the touchpad multitap tests over to ranged tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-08 14:08:58 +10:00
Peter Hutterer
ca10fc2be7 test: switch the abs ranged tests over to real ranged tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-08 14:08:57 +10:00
Peter Hutterer
b97ad3c174 test: add litest_add_ranged* functionality
litest_add_ranged* takes a range parameter that serves as the lower/upper
boundary for a loop. This enables tests to be run multiple times, avoiding the
timeouts we triggered by having the loops inside (e.g. see 2bf8d035c and
6dd02468).

This just wraps the underlying check framework, the ranged variable is
available as "_i" in the test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-08 14:08:57 +10:00
Peter Hutterer
12000e737e tools: add middle button emulation to listed capabilities
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-07 16:30:08 +10:00
Peter Hutterer
4a56ce17f0 test: use litest_is_button_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 16:18:10 +10:00
Peter Hutterer
fd301dfba2 test: add litest_is_keyboard_event() helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 16:17:50 +10:00
Peter Hutterer
cbfbede748 test: add litest_is_touch_event() helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 14:41:00 +10:00
Peter Hutterer
77eb2d5445 test: add litest_is_motion_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 14:40:59 +10:00
Peter Hutterer
2e38547c79 test: add litest_is_axis_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 14:40:59 +10:00
Peter Hutterer
6c2d2d7e6c test: re-order the tests to have the likely ones to fail first
Run the touchpad tests first, it's the most likely to fail. It also takes the
longest, so it's annoying to have it fail when you spent a minute watching the
other tests succeed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 14:40:59 +10:00
Peter Hutterer
799ee6c53e test: litest_is_button_event should take an unsigned int
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 14:40:59 +10:00
Benjamin Tissoires
0cd36225d7 touchpad: add support for per-finger hovering information
When the device supports true hovering, it reports this
information through ABS_MT_DISTANCE.
When this axis is available, we should rely on it to
(un)hover the touches as BTN_TOUCH is most of the time
unreliable (generated by the mouse emulation in the kernel).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-07 14:40:53 +10:00
Peter Hutterer
2af94a5dfd filter: add Simon's copyright
This code was largely lifted from the X server in
bb25b2ad29 but didn't take the copyright messages that
applied to that code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Simon Thum <simon.thum@gmx.de>
2015-05-07 08:02:58 +10:00
Benjamin Tissoires
92fc816bfe test: rename hover tests into semi_mt_hover
The current hover tests are uniquely designed for some Synaptics
touchpad. libinput can handle hovering through ABS_MT_DISTANCE,
so we need to reserve the "hover" name for real hovering devices.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-06 15:08:36 +10:00
Benjamin Tissoires
22a06792b1 test: bcm5974: down should be marked as static
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-06 15:08:22 +10:00
Peter Hutterer
e7572274df doc: add a page about the test suite
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-06 12:40:12 +10:00
Peter Hutterer
1ea69203ac test: return the right value from open_restricted
fd or negative errno on failure.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-06 11:56:40 +10:00
Peter Hutterer
3844856302 test: move a comment to where it belongs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-06 11:56:40 +10:00
Peter Hutterer
12df380698 configure.ac: libinput 0.15.0 - this time for real
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-05 17:20:35 +10:00
Peter Hutterer
103fad15e7 configure.ac: libinput 0.15.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-05 16:49:44 +10:00
Peter Hutterer
2bf8d035c4 test: split test for invalid ranges into hi/lo
This test can randomly trigger a timeout, depending on how busy the machine
is.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-05 16:49:44 +10:00
Peter Hutterer
91ae98c09c test: add helper function for creating a device not expected to be added
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-05 16:49:44 +10:00
Peter Hutterer
bb2678bfe8 touchpad: when clearing the touchpad state, release fake touches too
Causes an error message in the device_disable_release_tap_n_drag test. When
the touchpad is suspended, all touches are ended in tp_clear_state. Since the
hovering support was added, this returns the touches to TOUCH_HOVERING, a
subsequent tp_handle_state() will turn them back into TOUCH_BEGIN based on
BTN_TOUCH and BTN_TOOL_FINGER still being down.

Clear the fake touch buttons as well after ending the touches, this way the
touch points are reset to TOUCH_NONE as intended.
Once we do that we don't need to manually change the tap finger count when
releasing taps, we can just let the count reset naturally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-05 07:44:18 +10:00
Peter Hutterer
c9a3c7a7e3 touchpad: drop the tap finger count
Use tp->nfingers_down as trigger when we have no fingers left on the touchpad
and when we should return to idle. If all touchpoints end in the same frame
tp->nfingers is 0. Thus when we handle the first tap release we transition to
IDLE which now needs to handle (and discard) any touch release events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-05 07:44:18 +10:00
Peter Hutterer
d6867dfae0 touchpad: enable clickfinger by default on some System76 laptops
Bonobo, Clevo, Galago and Kudu have clickpads and no markings ->
enable clickfinger by default.

Lemur and Gazelle have physical buttons, no need for extra configuration.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-05 07:36:14 +10:00
Peter Hutterer
f52dbc5ad9 touchpad: enable clickfinger by default on chromebooks
This matches the vendor default.

Board IDs pulled from modinfo chromeos_laptop, touchpad names from a bit of
googling around.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-04 19:30:46 +10:00
Peter Hutterer
14025099db tools: add to, don't replace, the man page list
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-04 14:29:47 +10:00
Velimir Lisec
ff132b2cfb touchpad: increase drag timeout
libinput supports lifting a finger during dragging and setting it back down
again to continue the drag. Curently the drag timeout is set to
DEFAULT_TAP_TIMEOUT. That is to short, when we're dragging the finger needs to
have enough time to move from one edge of the touchpad to the other. 180ms is
too short for that and causes false timeouts and thus button releases that
cancel the drag.

Introduce DEFAULT_DRAG_TIMEOUT and set it to 500 ms.

Signed-off-by: Velimir Lisec <lisec.velimir@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-04 10:22:58 +10:00
Peter Hutterer
182b7b7da9 touchpad: fix double/multitap timeouts
The current doubletap timeout was incorrect, it gave the user only 180ms to
touch, release, touch, release to recognise a doubletap. But it would also set
a timeout on the second release, delaying the button events by 180ms.

Instead, re-arm the timer on the second touch down. This gives the user 180ms
to release and touch again (or time out). This makes doubletap much more
reliable and reduces the delay between the release and the button events
arriving since the finger down time is already counted.

Same fix for MULTITAP, though we already armed the timer on touch down so we
just have to remove the new timer on touch release which did little but delay
everything.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-04 10:22:58 +10:00
Peter Hutterer
d8ec73aead test: add timeout_tapndrag()
Prep work for the upcoming patch to extend the timeout for tap-and-drag.  And
switch the tests that rely on it over to the new function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-04 10:22:58 +10:00
Peter Hutterer
6dd02468ac test: reduce the multitap tests to 5 taps only
Reduces the risk of accidental timeouts

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-04 10:22:58 +10:00
Peter Hutterer
8ead828e6f Fix a couple of coding style issues
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-01 12:09:57 +10:00
Peter Hutterer
c2ef1854d8 timer: set O_NONBLOCK on the timerfd
Resetting a timerfd empties the data on the fd, so if the timer is reset
between triggering and us reading it, we may block trying to read it.

Since we read events off a device in a loop, a device sending a continuous
flow of events may cause the timer to trigger but delay reading it. If one of
the events cause e.g. the tap timer to be set, the timerfd may be empty at the
time of reading.

Suggested-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-01 09:09:38 +10:00
Derek Foreman
28ed7a6265 Set O_CLOEXEC when opening devices
We'd rather keep these out of the hands of children.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-01 08:56:11 +10:00