platform/upstream/libinput.git
4 years agogitlab-ci: force using docker format for the generated images
Benjamin Tissoires [Wed, 7 Aug 2019 09:57:01 +0000 (11:57 +0200)]
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>
4 years agogitlab-ci: allow to run on unprivileged containers
Benjamin Tissoires [Tue, 6 Aug 2019 11:32:16 +0000 (13:32 +0200)]
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>
4 years agogitlab CI: fetch the WAYLAND_WEB_TOKEN from a file
Peter Hutterer [Wed, 7 Aug 2019 03:42:36 +0000 (13:42 +1000)]
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>
4 years agogitlab CI: replace the user:password with a netrc file
Peter Hutterer [Wed, 7 Aug 2019 01:55:21 +0000 (11:55 +1000)]
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>
4 years agoevdev: always store user calibration matrix
Brian Ashworth [Sun, 4 Aug 2019 15:48:28 +0000 (11:48 -0400)]
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>
4 years agomeson.build: drop explicit install:true from configure_file
Peter Hutterer [Fri, 2 Aug 2019 12:45:16 +0000 (22:45 +1000)]
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>
4 years agotools: record: fix two memory leaks
Peter Hutterer [Wed, 31 Jul 2019 22:31:07 +0000 (08:31 +1000)]
tools: record: fix two memory leaks

Found by coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotools: record: fix segfault on exit
Peter Hutterer [Wed, 31 Jul 2019 22:28:13 +0000 (08:28 +1000)]
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>
5 years agolibinput 1.13.902 1.13.902
Peter Hutterer [Tue, 30 Jul 2019 09:45:05 +0000 (19:45 +1000)]
libinput 1.13.902

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: mix tablet events into touch arbitration tests
Peter Hutterer [Wed, 31 Jul 2019 00:20:50 +0000 (10:20 +1000)]
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>
5 years agoudev: Reproduce entire LIBINPUT_DEVICE_GROUP for paired ExpressKey Remote
Jason Gerecke [Fri, 26 Jul 2019 14:24:26 +0000 (07:24 -0700)]
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>
5 years agoIntroduce Dell Latitude 5580 trackpoint multiplier
Jacob Moroni [Sun, 28 Jul 2019 00:26:16 +0000 (20:26 -0400)]
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>
5 years agotools: record: when running from the builddir, load the quirks correctly
Peter Hutterer [Wed, 24 Jul 2019 03:33:11 +0000 (13:33 +1000)]
tools: record: when running from the builddir, load the quirks correctly

Fixes #324

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotools: handle arguments correctly for the YAML verifier tool
Peter Hutterer [Wed, 24 Jul 2019 03:32:58 +0000 (13:32 +1000)]
tools: handle arguments correctly for the YAML verifier tool

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotools: skip the event tests for eventless recordings in the YAML verifier
Peter Hutterer [Wed, 24 Jul 2019 03:32:15 +0000 (13:32 +1000)]
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>
5 years agolibinput 1.13.901 1.13.901
Peter Hutterer [Fri, 19 Jul 2019 01:30:37 +0000 (11:30 +1000)]
libinput 1.13.901

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoMerge branch 'wip/advanced-thumb-detection-v2'
Peter Hutterer [Wed, 17 Jul 2019 09:37:21 +0000 (19:37 +1000)]
Merge branch 'wip/advanced-thumb-detection-v2'

5 years agotouchpad: stricter thumb detection if no pressure/size
Matt Mayfield [Thu, 11 Jul 2019 15:14:37 +0000 (10:14 -0500)]
touchpad: stricter thumb detection if no pressure/size

5 years agotouchpad: don't detect speed-based thumbs if there's already a thumb
Matt Mayfield [Sun, 14 Jul 2019 17:50:14 +0000 (12:50 -0500)]
touchpad: don't detect speed-based thumbs if there's already a thumb

5 years agodoc/user: add documentation for the new thumb detection
Peter Hutterer [Wed, 10 Jul 2019 04:06:07 +0000 (14:06 +1000)]
doc/user: add documentation for the new thumb detection

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: revamp thumb detection
Matt Mayfield [Fri, 21 Jun 2019 03:19:22 +0000 (13:19 +1000)]
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>
5 years agotest: make the touchpad size the only check for thumb detection
Peter Hutterer [Wed, 10 Jul 2019 02:45:46 +0000 (12:45 +1000)]
test: make the touchpad size the only check for thumb detection

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: only run the speed finger tests when the touchpad has thumb detection
Peter Hutterer [Wed, 10 Jul 2019 02:10:42 +0000 (12:10 +1000)]
test: only run the speed finger tests when the touchpad has thumb detection

5 years agotest: only run the speed tests for clickpads
Peter Hutterer [Wed, 10 Jul 2019 02:07:09 +0000 (12:07 +1000)]
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>
5 years agotouchpad: only log edge scroll state changes when the state actually changes
Peter Hutterer [Wed, 10 Jul 2019 01:56:52 +0000 (11:56 +1000)]
touchpad: only log edge scroll state changes when the state actually changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: add a helper function for supressing a thumb
Peter Hutterer [Fri, 21 Jun 2019 01:26:11 +0000 (11:26 +1000)]
touchpad: add a helper function for supressing a thumb

Only sets the state to YES at the moment, will do more in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agogestures: Improve thumb detection, allow one finger scroll
Matt Mayfield [Fri, 31 Aug 2018 02:29:46 +0000 (21:29 -0500)]
gestures: Improve thumb detection, allow one finger scroll

Check if there's a thumb if we have two touches. If one finger moves but
the thumb remains still, we assume that one is really a thumb. But if the
thumb moves while the finger is still, let's assume this is a 2-finger scroll.

Extracted from Matt Mayfield's thumb detection patchset

5 years agogestures: fast-track scroll/swipe detection when gestures are off
Peter Hutterer [Thu, 20 Jun 2019 11:25:25 +0000 (21:25 +1000)]
gestures: fast-track scroll/swipe detection when gestures are off

We can't detect pinch when gestures are off anyway, so we don't need to check
the finger distances.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agogestures: improvements to pinch detection
Matt Mayfield [Sat, 25 Aug 2018 04:17:03 +0000 (23:17 -0500)]
gestures: improvements to pinch detection

Only bias towards scrolling if the fingers are in the position past the
timeout.

5 years agogestures: improve scroll responsiveness for vertically aligned touches
Matt Mayfield [Wed, 22 Aug 2018 02:12:33 +0000 (21:12 -0500)]
gestures: improve scroll responsiveness for vertically aligned touches

Put some basic location checks in, if the fingers are next to each other and
vertically close, assume scroll over swipe.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>:
5 years agotouchpad: basic thumb detection within gestures
Matt Mayfield [Sat, 18 Aug 2018 06:10:34 +0000 (01:10 -0500)]
touchpad: basic thumb detection within gestures

When a touchpad has thumb detection enabled, avoid false-positive gestures
involving a resting thumb by using two thresholds: inner and outer.

While both touches remain inside their inner thresholds, remain in UNKNOWN
state to allow for accurate gesture detection even with no timeout.

If both touches move outside their inner thresholds, start a pinch or
swipe/scroll gesture according to direction, as usual.

If one touch moves outside its outer threshold while the other has not yet
exceeded its inner threshold, and thumb detection is enabled, then if one
touch is >20mm lower, mark it as a thumb and cancel the gesture.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: rename the thumb detection methods
Peter Hutterer [Thu, 20 Jun 2019 00:56:17 +0000 (10:56 +1000)]
touchpad: rename the thumb detection methods

No functional changes, just prep work for a later patch where the thumbs will
dynamically update their state (instead of just using yes/no/maybe).

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: extract some bits of thumb detection into helper functions
Peter Hutterer [Thu, 20 Jun 2019 00:37:37 +0000 (10:37 +1000)]
touchpad: extract some bits of thumb detection into helper functions

No functional changes

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: move the speed-thumb detection code to the thumb helper file
Peter Hutterer [Wed, 19 Jun 2019 02:05:25 +0000 (12:05 +1000)]
touchpad: move the speed-thumb detection code to the thumb helper file

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: add helper function to reset a thumb's state
Peter Hutterer [Wed, 19 Jun 2019 02:04:23 +0000 (12:04 +1000)]
touchpad: add helper function to reset a thumb's state

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: explicitly start with detect_thumbs as false
Peter Hutterer [Wed, 19 Jun 2019 02:01:09 +0000 (12:01 +1000)]
touchpad: explicitly start with detect_thumbs as false

Not needed because we zalloc() anyway, but this makes it grep-able.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: add helper function for setting the thumb state
Peter Hutterer [Wed, 19 Jun 2019 01:57:45 +0000 (11:57 +1000)]
touchpad: add helper function for setting the thumb state

This moves the thumb state logging directly into that helper function too.

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: move tp_init_thumb and tp_thumb_detect to the thumb file
Peter Hutterer [Tue, 18 Jun 2019 00:53:39 +0000 (10:53 +1000)]
touchpad: move tp_init_thumb and tp_thumb_detect to the thumb file

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: add a helper function for counting touches for gestures
Peter Hutterer [Tue, 18 Jun 2019 00:21:13 +0000 (10:21 +1000)]
touchpad: add a helper function for counting touches for gestures

Currently the same as tp_touch_active() but this will change.

No functional changes.

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: add a helper function for checking thumb state
Peter Hutterer [Tue, 18 Jun 2019 00:16:33 +0000 (10:16 +1000)]
touchpad: add a helper function for checking thumb state

No functional changes

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: rename the scroll timeout define, drop the pinch one
Peter Hutterer [Tue, 18 Jun 2019 00:27:59 +0000 (10:27 +1000)]
touchpad: rename the scroll timeout define, drop the pinch one

The previously 'scroll'-named timeout is also used for swipe, so let's rename
it. And the pinch one isn't used at all.

Extracted from Matt Mayfield's thumb detection patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: reduce state debugging output by only logging changed states
Peter Hutterer [Tue, 18 Jun 2019 08:24:49 +0000 (18:24 +1000)]
touchpad: reduce state debugging output by only logging changed states

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoIntroduce Dell Latitude 5480 trackpoint multiplier. Otherwise the
Vladyslav Shtabovenko [Thu, 11 Jul 2019 09:20:32 +0000 (11:20 +0200)]
Introduce Dell Latitude 5480 trackpoint multiplier. Otherwise the
trackpoint is too sensitive.

5 years agodoc/user: fix a typo
Peter Hutterer [Wed, 10 Jul 2019 03:52:25 +0000 (13:52 +1000)]
doc/user: fix a typo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agomeson: run the test suite per group
Peter Hutterer [Wed, 26 Jun 2019 22:31:01 +0000 (08:31 +1000)]
meson: run the test suite per group

We can't run this in parallel so it doesn't gain us any speed advantage. If
anything, it'll be slower because it's more setup time in between. But: meson
doesn't display the result until the test suite finished, so having this
broken up into smaller chunks means we're more likely to see a general failure
early.

And the failure should be quicker to reproduce as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: use the default job control for --filter-groups
Peter Hutterer [Mon, 1 Jul 2019 02:20:44 +0000 (12:20 +1000)]
test: use the default job control for --filter-groups

All filter arguments currently force a -j1 unless otherwise specified. Change
this for --filter-group since that one is most likely invoked by some test
setup that can either add -j X or set the environment variable LITEST_JOBS as
well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agomeson.build: move the leftover udev rule check up
Peter Hutterer [Mon, 1 Jul 2019 02:34:09 +0000 (12:34 +1000)]
meson.build: move the leftover udev rule check up

ninja executes the test in the same order but we don't want to waste 5 minutes
testing other things when we have a udev rule leftover from a previous run.

Plus, this test can't be run in parallel with others, so in the worst case we
had to wait for several long-running tests to finish before this one could be
started.

To avoid all this, let's move this up to be the first check.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: fix an always-true check for udev properties
Peter Hutterer [Sun, 7 Jul 2019 23:53:49 +0000 (09:53 +1000)]
test: fix an always-true check for udev properties

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: fix two coverity warnings
Peter Hutterer [Sun, 7 Jul 2019 23:47:31 +0000 (09:47 +1000)]
test: fix two coverity warnings

Alleged division by zero and use of an uninitialized variable. Both cannot
happen the way we call the tests, so let's just abort to make coverity happy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: drop the litest feature enum, make it normal bits instead
Peter Hutterer [Mon, 1 Jul 2019 06:12:26 +0000 (16:12 +1000)]
test: drop the litest feature enum, make it normal bits instead

The coverity compiler can't handle 64-bit enums and since it does provide
useful data, let's switch this to #defines instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoFixed a grammar error
pixl [Fri, 5 Jul 2019 05:14:31 +0000 (05:14 +0000)]
Fixed a grammar error

5 years agotest: one O_NONBLOCK is enough
Peter Hutterer [Tue, 29 Jan 2019 04:34:47 +0000 (14:34 +1000)]
test: one O_NONBLOCK is enough

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoquirks: add touchpad range for cypress touchpads
Peter Hutterer [Wed, 26 Jun 2019 22:51:51 +0000 (08:51 +1000)]
quirks: add touchpad range for cypress touchpads

As found in the Dell XPS 12 9Q23

Fixes #310

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoquirks: rename the cyapa quirks file to cypress
Peter Hutterer [Wed, 26 Jun 2019 22:50:51 +0000 (08:50 +1000)]
quirks: rename the cyapa quirks file to cypress

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoevdev: when the kernel fuzz is nonzero, set ours to zero
Peter Hutterer [Tue, 25 Jun 2019 22:55:07 +0000 (08:55 +1000)]
evdev: when the kernel fuzz is nonzero, set ours to zero

Our udev callout is supposed to reset the kernel fuzz to 0 and move the value
to the LIBINPUT_FUZZ property. This is to stop the kernel from applying its
own hysteresis-like approach.

Where the kernel fuzz is nonzero, something has gone wrong with that approach.
Complain about it and set our fuzz to zero, we are in the hands of the kernel
now. If we leave our fuzz as nonzero, we'll apply our own hysteresis on top of
the kernel's and that leads to unresponsive behavior.

Fixes #313

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agomeson: force litest to use the right udev rules
Peter Hutterer [Thu, 27 Jun 2019 01:12:58 +0000 (11:12 +1000)]
meson: force litest to use the right udev rules

We generate litest-specific udev rules that contain the path to the binaries
in the builddir. But litest wasn't using those, so IMPORT would run things in
/usr/lib/udev instead. Thus any changes to those binaries generated false test
results depending on how compatible the system-installed libinput was.

This is why 410b157 passed the test suite for example.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotools: return 77 if gtk_init() fails in the debug-gui
Peter Hutterer [Wed, 26 Jun 2019 05:38:43 +0000 (15:38 +1000)]
tools: return 77 if gtk_init() fails in the debug-gui

And when that happens, skip the tests because what's happening here is that
you're running tests as root, but your X server doesn't allow root to connect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agomeson: increase the test time for the selftest suite
Peter Hutterer [Wed, 26 Jun 2019 07:05:41 +0000 (17:05 +1000)]
meson: increase the test time for the selftest suite

Because it's timing out on the XPS

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: disable coredumps for the selftest
Peter Hutterer [Wed, 26 Jun 2019 05:44:16 +0000 (15:44 +1000)]
test: disable coredumps for the selftest

Because on my XPS coredumps take away all the CPU, leading to a test timeout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoevdev: only extract the fuzz for touchpads and touchscreens
Peter Hutterer [Wed, 26 Jun 2019 03:55:36 +0000 (13:55 +1000)]
evdev: only extract the fuzz for touchpads and touchscreens

We don't have a hysteresis for tablet devices, so let's leave those as-is.

This may be a slight regression in behavior compared to pre-410b157e84 now the
kernel will apply the fuzz. Let's see if anyone notices, the fuzz is usually
so tiny on tablets that it shouldn't be noticable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoIf we never initialized the libwacom database, don't check the refcount
Peter Hutterer [Wed, 26 Jun 2019 04:15:09 +0000 (14:15 +1000)]
If we never initialized the libwacom database, don't check the refcount

If the libwacom context failed to initialize for some reason, the database is
NULL and the refcount remains at zero. Calling unref should just work then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotools: skip debug-gui option testing if the debug-gui is disabled
Peter Hutterer [Mon, 24 Jun 2019 23:37:25 +0000 (09:37 +1000)]
tools: skip debug-gui option testing if the debug-gui is disabled

Fixes #311

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoudev: only change the fuzz on touchpads and touchscreens (v2)
Peter Hutterer [Wed, 26 Jun 2019 01:31:56 +0000 (11:31 +1000)]
udev: only change the fuzz on touchpads and touchscreens (v2)

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>
5 years agoudev: rename libinput-model-quirks rules to libinput-fuzz-override.rules
Peter Hutterer [Wed, 26 Jun 2019 01:29:31 +0000 (11:29 +1000)]
udev: rename libinput-model-quirks rules to libinput-fuzz-override.rules

Because these days, that's all it does

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoRevert "udev: only change the fuzz on touchpads and touchscreens"
Peter Hutterer [Wed, 26 Jun 2019 01:19:23 +0000 (11:19 +1000)]
Revert "udev: only change the fuzz on touchpads and touchscreens"

This causes a regression - the ID_INPUT_* properties are not available through
libudev within a callout, the device we get here basically has no properties.

Reverts !231

This reverts commit 410b157e8487191a32acf5b3bf3811d40e96dac7.

5 years agotools: improve the error messages for measure touch-size/touchpad-pressure
Peter Hutterer [Mon, 24 Jun 2019 02:49:33 +0000 (12:49 +1000)]
tools: improve the error messages for measure touch-size/touchpad-pressure

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agodoc: note that libinput measure is a separate package
Peter Hutterer [Mon, 24 Jun 2019 02:48:20 +0000 (12:48 +1000)]
doc: note that libinput measure is a separate package

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: fix the slot swap test again
Peter Hutterer [Fri, 21 Jun 2019 00:35:33 +0000 (10:35 +1000)]
test: fix the slot swap test again

The previous movement was one finger still, the second finger moving. This may
cause axis events to trigger when a 2fg scroll gesture was detected. Those
axis events will stop after the gesture timeout but generate one more axis
stop event.

Make two changes here: first, move the fingers like a proper 2fg scroll
motion. And shuffle around the litest_drain_events() calls to ignore any axis
event immediately after the timeout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: avoid a pointer jump when testing for the slot continuation
Peter Hutterer [Thu, 20 Jun 2019 06:19:56 +0000 (16:19 +1000)]
test: avoid a pointer jump when testing for the slot continuation

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: fix the slot swap test
Peter Hutterer [Thu, 20 Jun 2019 06:38:07 +0000 (16:38 +1000)]
test: fix the slot swap test

This test worked because no gesture was detected in the initial movement.
If that happens though, releasing one finger triggers the gesture timeout
during which we suppress events, thus failing the test. Fix this by moving,
waiting, moving - that will definitely generate an event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: use an enum for the cardinals
Peter Hutterer [Thu, 20 Jun 2019 04:15:02 +0000 (14:15 +1000)]
test: use an enum for the cardinals

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: fix button area scroll test to not be a pinch
Peter Hutterer [Thu, 20 Jun 2019 03:38:47 +0000 (13:38 +1000)]
test: fix button area scroll test to not be a pinch

Second finger's x coordinate was wrong. That we didn't pick this up as pinch
is quite telling too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: move the fingers closer together for the empty-slot test
Peter Hutterer [Thu, 20 Jun 2019 03:36:57 +0000 (13:36 +1000)]
test: move the fingers closer together for the empty-slot test

If we're testing for this, let's not try to get it picked up as pinch
gestures. Only an issue on the wacom and magic trackpads because of their
physical size.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: change touchpad 2fg no-motion test to move both fingers simultaneously
Peter Hutterer [Thu, 20 Jun 2019 03:34:10 +0000 (13:34 +1000)]
test: change touchpad 2fg no-motion test to move both fingers simultaneously

In the future we may allow motion with one finger on the touchpad.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoX230 trackpoint quirk
timrichardson [Thu, 20 Jun 2019 03:55:49 +0000 (13:55 +1000)]
X230 trackpoint quirk

5 years agotest: replace a touch move with a timeout
Peter Hutterer [Tue, 18 Jun 2019 11:29:29 +0000 (21:29 +1000)]
test: replace a touch move with a timeout

We only care about the third-finger data here, the movement of the first two
was just to get out of the base tap states. A timeout will do the same thing
here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: fix initial coordinates for synaptics tripletap quirk
Peter Hutterer [Tue, 18 Jun 2019 11:00:55 +0000 (21:00 +1000)]
test: fix initial coordinates for synaptics tripletap quirk

I don't think there was a specific reason for the second touch point to jump
around here either and the comment indicates it was just to avoid the
clickfinger distance trigger. So let's just move the first touchpoint.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: don't form a pinch gesture for the clickfinger distance test
Peter Hutterer [Tue, 18 Jun 2019 10:52:42 +0000 (20:52 +1000)]
test: don't form a pinch gesture for the clickfinger distance test

If the fingers are in the position in the current code, that's not a 3fg
click, that's a pinch. Let's use something more realistic.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: don't go into the thumb area for the 3fg clickfinger distance check
Peter Hutterer [Tue, 18 Jun 2019 10:50:44 +0000 (20:50 +1000)]
test: don't go into the thumb area for the 3fg clickfinger distance check

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: remove two spurious SYN_REPORTs
Peter Hutterer [Tue, 18 Jun 2019 10:48:22 +0000 (20:48 +1000)]
test: remove two spurious SYN_REPORTs

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: add another test for thumb movements
Peter Hutterer [Tue, 18 Jun 2019 05:36:13 +0000 (15:36 +1000)]
test: add another test for thumb movements

Small movements mustn't trigger events, large movements should.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: fix the clickfinger thumb test
Peter Hutterer [Tue, 18 Jun 2019 05:13:05 +0000 (15:13 +1000)]
test: fix the clickfinger thumb test

This test was putting both fingers down in the thumb area. That's not
representative, it's more likely that a thumb is in the area and the second
finger clicks elsewhere. So let's test for that instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: rename/fix/move thumb tests
Peter Hutterer [Tue, 18 Jun 2019 02:08:19 +0000 (12:08 +1000)]
test: rename/fix/move thumb tests

These were supposed to test the thumb area, but the pressure exceeded the
threshold for most devices, thus ending up testing the palm detection instead.

Fix to use a timeout where possible, otherwise move them to the palm detection
code instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotouchpad: slightly change a debug message
Peter Hutterer [Tue, 18 Jun 2019 03:20:32 +0000 (13:20 +1000)]
touchpad: slightly change a debug message

Makes it clearer that thumb detection always enables area-based detection.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotablet: disable the forced proximity out for the Dell Canvas pen
Peter Hutterer [Mon, 17 Jun 2019 03:25:59 +0000 (13:25 +1000)]
tablet: disable the forced proximity out for the Dell Canvas pen

This pen has random timeouts, often when a button is pressed. This causes a
forced proximity out (and the button release) and makes the whole device a
tad unusable.

Nothing we can detect by heuristics since it looks like other devices that
don't send proximity out events. And the timeout can be quite high, the
recording in #304 has over 800ms for one sequence.

Fixes #304

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoquirk: drop the ModelTabletNoTilt quirk
Peter Hutterer [Mon, 17 Jun 2019 04:02:07 +0000 (14:02 +1000)]
quirk: drop the ModelTabletNoTilt quirk

This quirk is unused, use AttrEventCodeDisable instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotablet: fix double proximity out on slow proximity out pens
Peter Hutterer [Mon, 17 Jun 2019 01:18:57 +0000 (11:18 +1000)]
tablet: fix double proximity out on slow proximity out pens

Where the proximity out event is delayed by the kernel, libinput would cause
an extra proxmity in-out after the forced proximity out event.

Event sequence is basically (k: kernel, l: libinput)

k: tablet axis events
l: tablet axis events
k: nothing for $proximity timer milliseconds
l: tablet proximity out
k: proximity out event
l: proximity in event
l: proximity out event

Fixes #306

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: don't make timer offset errors fatal in gdb
Peter Hutterer [Mon, 17 Jun 2019 01:35:31 +0000 (11:35 +1000)]
test: don't make timer offset errors fatal in gdb

No way we can debug without triggering those, so let's not make them fatal.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoReplace one more __builtin_popcount with bitwise test
Michael Forney [Mon, 17 Jun 2019 02:37:37 +0000 (19:37 -0700)]
Replace one more __builtin_popcount with bitwise test

__builtin_popcount might not be available and in this case, a bitwise-and
can accomplish the same task.

Signed-off-by: Michael Forney <mforney@mforney.org>
5 years agoDon't return expression in function returning void
Michael Forney [Sat, 15 Jun 2019 21:31:03 +0000 (14:31 -0700)]
Don't return expression in function returning void

This is a constraint violation in ISO C[0].

[0] http://port70.net/~nsz/c/c11/n1570.html#6.8.6.4p1

Signed-off-by: Michael Forney <mforney@mforney.org>
5 years agoUse bitwise test instead of __builtin_popcount
Michael Forney [Sat, 15 Jun 2019 21:04:38 +0000 (14:04 -0700)]
Use bitwise test instead of __builtin_popcount

__builtin_popcount might not be available on all compilers, so using
it requires a configure check and fallback implementation. In fact
on gcc without an -march flag, it gets compiled to a function call to
libgcc. However, we only need to test whether multiple bits are set,
and this can be done easily with a bitwise and.

Signed-off-by: Michael Forney <mforney@mforney.org>
5 years agoAvoid case ranges in switch statement
Michael Forney [Sat, 15 Jun 2019 20:51:56 +0000 (13:51 -0700)]
Avoid case ranges in switch statement

Signed-off-by: Michael Forney <mforney@mforney.org>
5 years agoAvoid unnecessary VLAs
Michael Forney [Sat, 15 Jun 2019 20:50:33 +0000 (13:50 -0700)]
Avoid unnecessary VLAs

When the array length is fixed, or bounded by a fixed upper bound,
just use that fixed length.

Signed-off-by: Michael Forney <mforney@mforney.org>
5 years agoRemove semicolons after function definitions
Michael Forney [Sat, 15 Jun 2019 20:50:03 +0000 (13:50 -0700)]
Remove semicolons after function definitions

Signed-off-by: Michael Forney <mforney@mforney.org>
5 years agotest: only write one single rules file for our device quirks
Peter Hutterer [Mon, 10 Jun 2019 12:18:50 +0000 (22:18 +1000)]
test: only write one single rules file for our device quirks

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: auto-generate the udev rules
Peter Hutterer [Mon, 10 Jun 2019 12:00:40 +0000 (22:00 +1000)]
test: auto-generate the udev rules

We only ever set properties in the devices, so let's make that more explicit
and auto-generate the udev rule. This way we're hopefully better protected
from the various typos that hid in those rules over the years, but also be
prepared for passing the udev property key/value pairs elsewhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: remove invalid GOTO in udev rule
Peter Hutterer [Mon, 10 Jun 2019 12:08:33 +0000 (22:08 +1000)]
test: remove invalid GOTO in udev rule

This was always jumped over because for this device, the touchpad was never
set anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: adjust the relative pointer motion test for low-dpi devices
Peter Hutterer [Wed, 12 Jun 2019 04:24:57 +0000 (14:24 +1000)]
test: adjust the relative pointer motion test for low-dpi devices

This escaped us before because the MOUSE_DPI setting on the low-dpi device was
ignored thanks to a broken udev rule (see a future commit for that).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotest: replace the double assert macros with proper checks
Peter Hutterer [Wed, 12 Jun 2019 04:11:00 +0000 (14:11 +1000)]
test: replace the double assert macros with proper checks

Instead of value * 256 which makes for bad debug messages, expand it to a full
double test with a 1/256 epsilon.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agotools: describe the various debug-gui features in the man page
Peter Hutterer [Thu, 13 Jun 2019 00:54:22 +0000 (10:54 +1000)]
tools: describe the various debug-gui features in the man page

There are too many things now to make it immediately obvious, let's describe
all this accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>