Commit graph

3926 commits

Author SHA1 Message Date
Peter Hutterer
c84366e85e Split utility functions into separate source files
libinput-util.h is getting a bit of a catchall bucket and it includes things
like libinput-private.h which in turn includes libwacom. This makes
libinput-util.h less useful for bits that only need e.g. the string processing
utilities.

So let's split them all up in to separate files, to be used as-needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:23:04 +10:00
Peter Hutterer
00f3345b80 test: do run the util tests under valgrind
These tests include string parsers, definitely want those to run under
valgrind to detect OOB reads and writes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:21:44 +10:00
Peter Hutterer
27632555e1 tools: flake8 fixes for the various python files
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:02:58 +10:00
Peter Hutterer
975ff2fb6e tools: change python invocations to use /usr/bin/env python3
Let's be consistent here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:02:58 +10:00
Peter Hutterer
bd8123e459 tools: install local quirks during libinput replay
The quirks for each device are listed in the recording but they may not apply
during libinput replay (e.g. for DMI matches). Work around this by writing out
the local-overrides.quirks file before initializing the devices. This way
we're guaranteed that the device is identical as on the reporter's machine.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 09:41:46 +10:00
Peter Hutterer
93e91536db tools: make an infinite loop more obvious in the code
Nothing sets "stop", so we might as well make it a while True

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 09:13:36 +10:00
Peter Hutterer
73849515ef tools: factor out a sanity check in libinput-replay
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 09:13:36 +10:00
Richard McIntosh
4f9a795765 Added magic trackpoint multiplier for Thinkpad 13 G2 2019-09-08 15:21:11 +02:00
RussianNeuroMancer
8635d546ce Mark HP Elite x2 1013 G3 keyboard as external
Keyboard+touchpad is external:
http://h10032.www1.hp.com/ctg/Manual/c06077534 (page 12)
2019-09-03 08:02:28 +00:00
RussianNeuroMancer
3c13dd9ccd Tablet Mode Switch on HP Elite x2 1013 G3 is unreliable:
https://bugzilla.kernel.org/show_bug.cgi?id=204719
https://bugzilla.kernel.org/show_bug.cgi?id=204739

Keyboard+touchpad is external:
http://h10032.www1.hp.com/ctg/Manual/c06077534 (page 12)
2019-08-30 15:09:01 +00:00
Peter Hutterer
7a12e460c0 libinput 1.14.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-26 11:38:05 +10:00
Matt Mayfield
73d55cc6c5 touchpad: don't allow gestures with a clickpad button down by a finger
Allowing gestures when holding a physical click enables tasks like
switching workspaces while dragging an icon, but this should only be
possible with a *thumb* holding down the clickpad, not fingers. This
commit restores the ability to hold down the clickpad with two or three
fingers to right- or middle-drag.

Fixes #339, #340

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-16 14:48:52 +10:00
Ronan Pigott
ac007401bb tools: fix typo in debug-events 2019-08-13 15:26:53 -07:00
Ronan Pigott
a67b652332 completion: add libinput(1) zsh completions 2019-08-13 15:05:35 -07:00
Kevin Kaland
894d8fe0d3 Fix double click button.
This fixes the double click button on the RollerMouse v3 (USB ID 0b33:1004).
2019-08-11 20:02:18 +00:00
Peter Hutterer
cc35d33f29 libinput 1.14.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 14:58:55 +10:00
Peter Hutterer
d93feba134 tablet: scale the available pressure range into the pressure thresholds
Pens that don't have a pressure offset (caused by a worn-out tip) still have
basic pressure thresholds to avoid tip events when we're still a bit away from
the tablet or barely touching it. That range is currently 5% of the pressure
for tip down, 1% for tip up.

This leaves us with 95% of the range and that needs to be scaled correctly,
otherwise the bottom 5% happen before a tip event and are inaccessible where
applications don't look at pressure before tip down.

Fixes #332

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
78efec3d2f test: don't test at the 100 y range
Theoretically this shouldn't matter, but testing at the far end of the range
is bound to trigger some little issues eventually that should be triggered
explicitly, not by accident.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
72121d6f6c tablet: reduce the pressure range by the offset
Previously, the pressure range was calculated from the axis total range. A
device with a pressure offset making the bottom 10% inaccessible would lose
10% of that range as non-accessible. Due to the implementation, this affected
the upper range of the device, so the top N percent became unaccessible. Which
may be why no-one's noticed this yet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
f97e361d5d tablet: make the pressure-offset inclusive of the axis minimum
The offset handling was inconsistent, stored as relative to the axis minimum
but used as absolute in some places. Fix this by always using the absolute
value including the minimum (i.e. no pressure offset means offset == minimum).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
ad13116f4e test: fix the pressure offset tests
Unsuprisingly, a normalized [0,1] value will always be between 0 and 1, so
bhis gave us a false positive. Check for the real values instead.

Those values aren't 100% correct because of a bug in the offset handling which
will be fixed in a follow-up commit. The difference is near enough that it
doesn't matter here anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
031fbc84bd Add the ck_double_eq_tol() macros to the backwards compat headers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
a71d091e59 tablet: add a comment explaining why we adjust the pressure offset downwards
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 12:54:52 +10:00
Peter Hutterer
c5865f3ef0 tablet: point the pressure offset log messages to the right URL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 12:54:52 +10:00
Benjamin Tissoires
576bc2e5e6 tests: increase the timeout for the subprocess to receive the quit signal
On a very loaded machine, the process might not receive the quit signal
in a timely manner, and this introduce false positive results.

Add a longer timeout. This shouldn't interfere with the global time
spent in the tests, but will allow some loaded environment to pass
the tests.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-08-07 14:28:22 +02:00
Benjamin Tissoires
1e98b7e843 gitlab-ci: force using docker format for the generated images
See https://gitlab.freedesktop.org/freedesktop/freedesktop/issues/178#note_203050

Some shared runners are not capable of understanding OCI format for
container images, and they are failing.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-08-07 11:57:01 +02:00
Benjamin Tissoires
d5662590d4 gitlab-ci: allow to run on unprivileged containers
This parameter is already included by default in ci-templates, but
we also need it in freebsd

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-08-07 11:51:52 +02:00
Peter Hutterer
2c6e90f4be gitlab CI: fetch the WAYLAND_WEB_TOKEN from a file
This way it can't leak into the meson testlog.txt during the other stages.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-07 13:43:31 +10:00
Peter Hutterer
b1181bdd2f gitlab CI: replace the user:password with a netrc file
Gitlab supports masked tokens that get sanitized during log output but these
tokens are still in the environment. meson dumps the environment into
testlog.txt, resulting in our tokens leaking.

Avoid that leak by using a netrc file instead. The token value now refers to
the file name which is safe enough to leak into the test logs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-07 13:28:27 +10:00
Brian Ashworth
801485afda evdev: always store user calibration matrix
In evdev_device_calibrate, the user matrix was not being stored when it
was the identity matrix. This resulted in
libinput_device_config_calibration_get_matrix not providing the correct
matrix. Instead of giving the identity matrix, the last non-identity
matrix set was given.

This just moves the storage of the user matrix in
evdev_device_calibrate to be above the identity matrix early return so
that it always get stored.

Signed-off-by: Brian Ashworth <bosrsf04@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-05 09:58:06 +10:00
Peter Hutterer
f5fc850a08 meson.build: drop explicit install:true from configure_file
meson implicitly sets install to whether install_dir is nonzero. Which means
it's superfluous anyway and removing it drops the meson warning:

WARNING: Project specifies a minimum meson_version '>= 0.41.0' but uses
features which were added in newer versions:
 * 0.50.0: {'install arg in configure_file'}

Fixes #334

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-02 22:45:16 +10:00
Peter Hutterer
4ab8a51b68 tools: record: fix two memory leaks
Found by coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-01 08:41:01 +10:00
Peter Hutterer
803519ae59 tools: record: fix segfault on exit
If we don't supply --with-libinput, the device is NULL so we can't unref it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-01 08:40:58 +10:00
Peter Hutterer
5b20d7f482 libinput 1.13.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 10:23:29 +10:00
Peter Hutterer
057fd339d1 test: mix tablet events into touch arbitration tests
We keep running into the proximity timeout for these tests, especially under
valgrind. To avoid this, manually intersperse the touch events with tablet
events.

Note that this manual loop would just work even without tablet events
because we no longer have a 10ms delay between touch events as enforced by
litest_touch_move_to. But let's do the right thing anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 10:23:29 +10:00
Jason Gerecke
5521ab03f4 udev: Reproduce entire LIBINPUT_DEVICE_GROUP for paired ExpressKey Remote
In order for two devices to be in the same group, they need to share
identical LIBINPUT_DEVICE_GROUP attributes. The `wacom_handle_ekr` function
overwrites the VID/PID for an ExpressKey Remote, but the 'phys' path is
left unchanged. This only works if the EKR and the device we want to pair
it with are both direct sibings in the USB tree. It isn't always possible
to actually connect the devices like this, however. The Cintiq Pro 32 and
24, for instance, have multiple internal USB hubs and place the pen sensor
and the USB port for the EKR dongle behind different ones.

By copying the 'phys' path of the device we want to pair with, it is
possible to reproduce the entire LIBINPUT_DEVICE_GROUP and ensure that
the two devices actually end up paired in libinput.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
2019-07-29 22:38:36 +00:00
Jacob Moroni
7ee232a91d Introduce Dell Latitude 5580 trackpoint multiplier
It is required, otherwise the trackpoint is too sensitive.

Tested with a Dell Latitude 5580.

Signed-off-by: Jacob Moroni <mail@jakemoroni.com>
2019-07-27 20:26:16 -04:00
Peter Hutterer
9c2ac8f9ee tools: record: when running from the builddir, load the quirks correctly
Fixes #324

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 14:57:56 +10:00
Peter Hutterer
b436585b5e tools: handle arguments correctly for the YAML verifier tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 14:57:56 +10:00
Peter Hutterer
9807019096 tools: skip the event tests for eventless recordings in the YAML verifier
When verifying a recording, let's skip those tests that require events but
don't have any.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 14:57:36 +10:00
Peter Hutterer
bfec41b7a5 libinput 1.13.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-19 11:30:37 +10:00
Peter Hutterer
de2767b152 Merge branch 'wip/advanced-thumb-detection-v2' 2019-07-17 19:37:21 +10:00
Matt Mayfield
c284d4aaf0 touchpad: stricter thumb detection if no pressure/size 2019-07-17 09:33:14 +10:00
Matt Mayfield
35fd6e6c4e touchpad: don't detect speed-based thumbs if there's already a thumb 2019-07-17 09:33:14 +10:00
Peter Hutterer
94a7cd4959 doc/user: add documentation for the new thumb detection
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-17 09:33:14 +10:00
Matt Mayfield
4536b5b38f touchpad: revamp thumb detection
Instead of a simple yes/no/maybe for thumbs, have a more extensive state
machine that keeps track of the thumb. Since we only support one thumb anyway,
the tracking moves to the tp_dispatch struct.

Test case changes:
touchpad_clickfinger_3fg_tool_position:
  with better thumb detection we can now handle this properly and expect a
  right button (2fg) press for the test case
touchpad_thumb_no_doublethumb_with_timeout:
  two thumbs are now always two fingers, so let's switch to axis events here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-17 09:33:14 +10:00
Peter Hutterer
dda6f733af test: make the touchpad size the only check for thumb detection
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
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