platform/upstream/libinput.git
3 years agoquirks: add pressure ranges for the Dell Latitude E5510 TouchPad
Gablegritule [Mon, 8 Feb 2021 22:11:06 +0000 (22:11 +0000)]
quirks: add pressure ranges for the Dell Latitude E5510 TouchPad

The default setting makes the "Dell Latitude E5510 TouchPad" too sensitive and
consequently difficult to use.

Note that the the size of the TouchPad is detected to be higher than it is
(the side-bars are half out of the TouchPad), see
https://github.com/systemd/systemd/pull/18493 for the hwdb overrides for this
device.

Signed-off-by: Gablegritule <guillet.gabriel@laposte.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoCreate /etc/libinput on install
Peter Hutterer [Wed, 3 Feb 2021 00:19:20 +0000 (10:19 +1000)]
Create /etc/libinput on install

Users that need to create the local-overrides.quirks are sometimes hesitant to
do so because /etc/libinput doesn't exist by default. Let's create it on
install.

Related #568

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotouchpad: disable the pressure axes wherever the resolution is nonzero
Peter Hutterer [Thu, 4 Feb 2021 22:35:10 +0000 (08:35 +1000)]
touchpad: disable the pressure axes wherever the resolution is nonzero

The kernel/udev set the pressure resolution to nonzero to indicate the value
is in a known scale (units/g). We use that information to disable the
pressure axis on such devices - real pressure cannot be translated to
contact size.

For the kernel patch see:
https://www.spinics.net/lists/linux-input/msg71237.html

Fixes #569

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: don't require root to list tests
Peter Hutterer [Fri, 5 Feb 2021 01:21:47 +0000 (11:21 +1000)]
test: don't require root to list tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: reword the requirements section in the quirks README
Peter Hutterer [Tue, 2 Feb 2021 23:36:29 +0000 (09:36 +1000)]
quirks: reword the requirements section in the quirks README

Change the wording from "these will fail" to "this must be followed" which is
easier to understand. And add the requirement for uppercase hex numbers as
enforced since c412924003b3154.

Related #568

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agodoc/user: expand the explanations on how to submit a merge request
Peter Hutterer [Wed, 3 Feb 2021 04:50:23 +0000 (14:50 +1000)]
doc/user: expand the explanations on how to submit a merge request

I keep answering this in bug reports, much easier to just have a link to
copy/paste.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agodoc/user: some whitespace fixes
Peter Hutterer [Wed, 3 Feb 2021 04:15:22 +0000 (14:15 +1000)]
doc/user: some whitespace fixes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: improve the README
Peter Hutterer [Tue, 2 Feb 2021 01:54:14 +0000 (11:54 +1000)]
quirks: improve the README

Make the headers valid markdown and reword/reformat a few other things
to make it clearer and easier to read.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agolibinput 1.16.901 1.16.901
Peter Hutterer [Mon, 1 Feb 2021 09:14:10 +0000 (19:14 +1000)]
libinput 1.16.901

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoDell touchpad was too sensitive with default settings
Gary Wolfe [Mon, 25 Jan 2021 13:25:13 +0000 (08:25 -0500)]
Dell touchpad was too sensitive with default settings

The touchpad for the Dell Inspiron 15R N5110 was too sensitive with default settings, leading to excessive movement when lifting finger.

Fixes #565

Signed-off-by: Gary Wolfe <avidgamefan@yahoo.com>
3 years agotools: add a tool to analyze the finger count from a recording
Peter Hutterer [Sun, 24 Jan 2021 22:17:21 +0000 (08:17 +1000)]
tools: add a tool to analyze the finger count from a recording

Given a libinput recording, print the timestamps of any finger changes, i.e.
which slots are currently logically down. For example:

Timestamp | Rel time |     Slots     |
--------------------------------------
 0.000000 |  +0.000s | + |   |   |   |
 0.454631 |  +0.454s |   |   |   |   |
 5.065401 |  +4.610s | + |   |   |   |
 6.140281 |  +1.074s | + | + |   |   |
 7.410377 |  +1.270s |   | + |   |   |
 7.420200 |  +0.009s |   |   |   |   |
11.233108 |  +3.812s | + | + |   |   |
11.850206 |  +0.617s |   |   |   |   |
13.827740 |  +1.977s | + |   |   |   |
14.704027 |  +0.876s | + | + |   |   |
16.050577 |  +1.346s | + |   |   |   |
16.905186 |  +0.854s |   |   |   |   |

This data is available with the per-slot-delta tool but the output here is
more compressed, making it easier to detect stuck fingers. Pressure
thresholds are not currently supported.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/record: print the wall clock time every few seconds
Peter Hutterer [Mon, 25 Jan 2021 07:22:04 +0000 (17:22 +1000)]
tools/record: print the wall clock time every few seconds

For long-running recordings it's useful to know what the actual time was when
a particular event occured. A user can simply check the clock or system logs
for the time and thus know which portion of the recording to focus on.

Let's print the time into the recording, every 5 seconds (aligned at the 5,
10, 15s marks) or, if no events occured in the last 5 seconds, before the next
event. This granularity should be enough to identify the interesting parts of
a recording.

Let's print this as a comment until we have a use-case that requires parsing
this data.

The timer is the simplest approach, it just repeats at a fixed 5 seconds
interval from startup. There may be time drift, we can fix that if needed.

Fixes #560

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/record: use a pointer to the libinput fd poll entry
Peter Hutterer [Mon, 25 Jan 2021 07:12:12 +0000 (17:12 +1000)]
tools/record: use a pointer to the libinput fd poll entry

No functional changes, this makes the code slightly more readable, especially
once we start adding more "special" fds.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/record: use a pointer to the signalfd poll entry
Peter Hutterer [Mon, 25 Jan 2021 07:05:00 +0000 (17:05 +1000)]
tools/record: use a pointer to the signalfd poll entry

No functional changes, this makes the code slightly more readable, especially
once we start adding more "special" fds.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/record: narrow the scope of two variables
Peter Hutterer [Mon, 25 Jan 2021 06:30:22 +0000 (16:30 +1000)]
tools/record: narrow the scope of two variables

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/record: initialize all pollfds in the same loop
Peter Hutterer [Mon, 25 Jan 2021 05:56:03 +0000 (15:56 +1000)]
tools/record: initialize all pollfds in the same loop

Minor tidying up the code, set the default values for all fds in the same loop
instead of having it split to wherever the fd is created.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoUse python black for all pyhon file formatting
Peter Hutterer [Mon, 25 Jan 2021 03:12:25 +0000 (13:12 +1000)]
Use python black for all pyhon file formatting

Let's enforce a consistent (and verifiable) style everywhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agodoc: fix IRC channel name
Jonas Ådahl [Thu, 28 Jan 2021 07:32:03 +0000 (08:32 +0100)]
doc: fix IRC channel name

It said #wayland-devel, but it's #wayland.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
3 years agomodify macro streq/strneq for check one null pointer
weizhixiang [Fri, 8 Jan 2021 06:16:54 +0000 (14:16 +0800)]
modify macro streq/strneq for check one null pointer

Signed-off-by: weizhixiang <1138871845@qq.com>
Minor modifications applied by Peter Hutterer <peter.hutterer@who-t.net>

3 years agoquirks: disable pressure on the Lenovo Yoga 9i touchpad
Peter Hutterer [Thu, 14 Jan 2021 02:55:30 +0000 (12:55 +1000)]
quirks: disable pressure on the Lenovo Yoga 9i touchpad

This touchpad is a true pressurepad and the pressure axis gives us physical
pressure down. Using it as contact size gives flaky touch detection, so let's
just disable the axis until we do something with that value.

Fixes #562

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agodoc/user: list the known package repositories for libinput from git
Peter Hutterer [Thu, 7 Jan 2021 01:26:01 +0000 (11:26 +1000)]
doc/user: list the known package repositories for libinput from git

Because dnf install is a lot easier than building from git where one just
wants to test the latest libinput.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agocheck return value for libudev/udev_device_get_action
weizhixiang [Wed, 6 Jan 2021 09:46:14 +0000 (17:46 +0800)]
check return value for libudev/udev_device_get_action

Signed-off-by: weizhixiang <1138871845@qq.com>
3 years agogitlab CI: use Fedora 33
Peter Hutterer [Mon, 4 Jan 2021 00:25:43 +0000 (10:25 +1000)]
gitlab CI: use Fedora 33

This requires the latest CI templates for the updated mkosi fixes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: fix flake8 complaints
Peter Hutterer [Mon, 4 Jan 2021 01:15:51 +0000 (11:15 +1000)]
gitlab CI: fix flake8 complaints

tools/libinput-measure-fuzz.py:212:15:
 F523 '...'.format(...) has unused arguments at position(s): 1

But the E741 is better turned off in general:
  tools/libinput-measure-fuzz.py:319:29: E741 ambiguous variable name 'l'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotreewide: fix typos
Torstein Husebø [Thu, 27 Aug 2020 17:52:34 +0000 (19:52 +0200)]
treewide: fix typos

Signed-off-by: Torstein Husebø <torstein@huseboe.net>
3 years agodoc: somewhat document the write_open for lid switches
Peter Hutterer [Wed, 16 Dec 2020 00:47:58 +0000 (10:47 +1000)]
doc: somewhat document the write_open for lid switches

Not a full documentation but slightly more information than before. This is
too niche to document it fully, we're only using it on one device anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agodoc/user: document that we're only using internal devices for DWT
Peter Hutterer [Tue, 15 Dec 2020 05:46:50 +0000 (15:46 +1000)]
doc/user: document that we're only using internal devices for DWT

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoMatch all Surface (Pro/Laptop/Book) devices.
Blaž Hrastnik [Tue, 15 Dec 2020 03:39:23 +0000 (12:39 +0900)]
Match all Surface (Pro/Laptop/Book) devices.

Signed-off-by: Blaž Hrastnik <blaz@mxxn.io>
3 years agotouchpad: increase the jump detection interval to 30ms
Peter Hutterer [Wed, 25 Nov 2020 03:26:16 +0000 (13:26 +1000)]
touchpad: increase the jump detection interval to 30ms

On serial touchpads it's common enough that frames slow down tofrom the usual
12ms to 24ms. That's too close to our 25ms cutoff so if we have a minor delay,
we end up missing out on jump detection.

Fixes #541

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: don't allow VM test failures
Peter Hutterer [Wed, 9 Dec 2020 11:18:58 +0000 (21:18 +1000)]
gitlab CI: don't allow VM test failures

The VM runs are much more reliable now and where they do fail, they can be
retriggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: plug a leak in the tablet smoothing test
Peter Hutterer [Mon, 14 Dec 2020 08:57:31 +0000 (18:57 +1000)]
test: plug a leak in the tablet smoothing test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: plug a memleak in a quirks test
Peter Hutterer [Wed, 9 Dec 2020 11:21:24 +0000 (21:21 +1000)]
test: plug a memleak in a quirks test

Introduced in 56f4af51eca4ceec30e382d0d7c9972a57fd1aa2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: add quirk for Dell XPS 15 9500 touchpad
Jef Driesen [Mon, 7 Dec 2020 19:28:45 +0000 (20:28 +0100)]
quirks: add quirk for Dell XPS 15 9500 touchpad

The Dell XPS 15 9500 has a large touchpad without any visible markers
for the touchpad buttons. Since the ModelTouchpadVisibleMarker quirk is
enabled by default for all Dell touchpads, the middle button area ends
up too small. Disable the quirk again for this specific model.

Fixes #545

Signed-off-by: Jef Driesen <jefdriesen@telenet.be>
3 years agotest: add a test for model quirk overrides
Peter Hutterer [Mon, 7 Dec 2020 23:58:16 +0000 (09:58 +1000)]
test: add a test for model quirk overrides

Related to #545

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotablet: disable smoothing for AES devices
Peter Hutterer [Wed, 7 Oct 2020 23:47:36 +0000 (09:47 +1000)]
tablet: disable smoothing for AES devices

Data in
https://gitlab.freedesktop.org/libinput/libinput/-/issues/225#note_379034
suggests that AES devices have lower noise than the older EMR
devices, so let's try disabling it for those devices.

We can't directly get the AES devices in libinput unless we want to add a
whole bunch of quirks for the various vid/pid combinations. But we can get
that info from libwacom, primarily because we know that libwacom will list all
known AES pens for any device. So we can check for one that we know of (0x11)
and if it's in the list, the tablet is an AES tablet.

Setting the history size to 1 means we never do any actual smoothing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoudev: update rules to handle bind/unbind events
Peter Hutterer [Wed, 18 Nov 2020 01:07:02 +0000 (11:07 +1000)]
udev: update rules to handle bind/unbind events

Summary: we expect add, change or remove but kernel 4.12 added bind and
unbind. These events were previously discarded by udevd. Our rules should
handle any event *but* remove, so update as suggested in the announce email
linked below.

For a longer explanation, see the system 247rc2 announcement
https://lists.freedesktop.org/archives/systemd-devel/2020-November/045570.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: check commits/CI template generation before spinning up containers
Peter Hutterer [Mon, 23 Nov 2020 03:19:48 +0000 (13:19 +1000)]
gitlab CI: check commits/CI template generation before spinning up containers

If either of those fails, no point in trying to generate containers.
And move the MR check down to the deploy stage where it belongs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: use ci-fairy generate-template --verify
Peter Hutterer [Mon, 23 Nov 2020 03:16:14 +0000 (13:16 +1000)]
gitlab CI: use ci-fairy generate-template --verify

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: use the CI-fairy image
Peter Hutterer [Mon, 23 Nov 2020 03:13:09 +0000 (13:13 +1000)]
gitlab CI: use the CI-fairy image

This removes the need to pull a docker image for each of those stages.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: add curl to the debian image
Peter Hutterer [Mon, 16 Nov 2020 03:25:09 +0000 (13:25 +1000)]
gitlab CI: add curl to the debian image

The coverity job on debian needs curl.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: generate the package lists from the config.yaml
Peter Hutterer [Wed, 11 Nov 2020 05:07:34 +0000 (15:07 +1000)]
gitlab CI: generate the package lists from the config.yaml

The string list is getting too confusing.

This gets rid of the separate packageset for qemu. That packageset only
differed by adding valgrind, we can just keep that in the same list.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: update to latest templates
Peter Hutterer [Tue, 10 Nov 2020 23:08:52 +0000 (09:08 +1000)]
gitlab CI: update to latest templates

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: remove unused custom ubuntu install script
Peter Hutterer [Wed, 11 Nov 2020 23:34:33 +0000 (09:34 +1000)]
gitlab CI: remove unused custom ubuntu install script

Looks like this has been obsolete since
4df2ac731ff3ae420081b3e243fc2cec636bdfd6 where it stopped passing in the
packages.

And a bug caused the template to checked the "version" against "ubuntu", so
the script hasn't actually been included in any job anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: update Ubuntu to current distros
Peter Hutterer [Sun, 8 Nov 2020 21:50:08 +0000 (07:50 +1000)]
gitlab CI: update Ubuntu to current distros

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: rename FREEBSD_PKGS to FREEBSD_PACKAGES for consistency
Peter Hutterer [Wed, 11 Nov 2020 01:18:30 +0000 (11:18 +1000)]
gitlab CI: rename FREEBSD_PKGS to FREEBSD_PACKAGES for consistency

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: switch the coverity job to Debian stable
Peter Hutterer [Wed, 11 Nov 2020 01:16:06 +0000 (11:16 +1000)]
gitlab CI: switch the coverity job to Debian stable

coverity doesn't work with gcc 10, it fails with "invalid GNU version
number: 201". F31 is about to be EOL but we can't use to F32 or later.

So let's switch to debian stable instead, that one will stick around for a bit
longer.

Debian packages are the same as the Ubuntu packages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: Fedora only needs git-core, not git
Peter Hutterer [Wed, 11 Nov 2020 01:12:17 +0000 (11:12 +1000)]
gitlab CI: Fedora only needs git-core, not git

The other lines are just for indentation to match up

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: use a template for the various ci-fairy jobs
Peter Hutterer [Tue, 10 Nov 2020 23:13:20 +0000 (09:13 +1000)]
gitlab CI: use a template for the various ci-fairy jobs

And switch to python:alpine, an image that is tiny and sufficient for the job
we want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: switch to the vmctl script
Peter Hutterer [Sun, 8 Nov 2020 21:18:32 +0000 (07:18 +1000)]
gitlab CI: switch to the vmctl script

See ci-templates commit acda94e139030dc2caa058118956225e55bbec5f, it replaces
vm interactions with vmctl start/stop/exec and sets up an ssh config for the
hostname 'vm'.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: pass MESON_ARGS down to the wayland-web job
Peter Hutterer [Tue, 10 Nov 2020 07:40:40 +0000 (17:40 +1000)]
gitlab CI: pass MESON_ARGS down to the wayland-web job

Now that we're firing the wayland website generation as trigger, we're
automatically passing down the variables to the pipeline. Let's pass down
something sensible, we already had one issue with our space-separated
'build dir' and let's not require more than absolutely necessary to build
the docs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools: print the AttrEventCodeEnable and AttrInputPropEnable/Disable quirks
Peter Hutterer [Tue, 10 Nov 2020 03:32:26 +0000 (13:32 +1000)]
tools: print the AttrEventCodeEnable and AttrInputPropEnable/Disable quirks

Introduced in e3c4ff3 and e882bd02

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoFix a few coverity complaints
Peter Hutterer [Tue, 10 Nov 2020 03:09:00 +0000 (13:09 +1000)]
Fix a few coverity complaints

All minor:
- execdir does not need initialization, it's not used until written to
- 'newest' could be NULL
- zalloc(-1) confuses coverity
- 't' is never used in that test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoFix the termination of the readlink result
Peter Hutterer [Tue, 10 Nov 2020 04:25:31 +0000 (14:25 +1000)]
Fix the termination of the readlink result

nread is the number of bytes put into the buffer, let's terminate it there
instead of one byte over. This only worked because execdir was initialized to
zero.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: update the comments
Peter Hutterer [Fri, 30 Oct 2020 00:44:23 +0000 (10:44 +1000)]
gitlab CI: update the comments

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: update to latest ci-templates
Peter Hutterer [Fri, 30 Oct 2020 00:41:18 +0000 (10:41 +1000)]
gitlab CI: update to latest ci-templates

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: remove a now-unused VERSION variable
Peter Hutterer [Fri, 30 Oct 2020 00:38:47 +0000 (10:38 +1000)]
gitlab CI: remove a now-unused VERSION variable

This became obsolete with FDO_DISTRIBUTION_VERSION being autogenerated by
templates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: trigger the wayland website pipeline directly
Peter Hutterer [Tue, 27 Oct 2020 05:49:58 +0000 (15:49 +1000)]
gitlab CI: trigger the wayland website pipeline directly

See the documentation here:
https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#trigger-a-pipeline-when-an-upstream-project-is-rebuilt

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agodoc/user: update the timer offset warning for the new "too slow" message
Peter Hutterer [Thu, 22 Oct 2020 05:10:38 +0000 (15:10 +1000)]
doc/user: update the timer offset warning for the new "too slow" message

Related #533

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoevdev: reduce the "your system is slow" warning to 5 per hour
Peter Hutterer [Thu, 22 Oct 2020 04:59:03 +0000 (14:59 +1000)]
evdev: reduce the "your system is slow" warning to 5 per hour

Two cases where this can happen: system is currently slow and delaying events,
n which case we'll get a burst and it'll show up in the log files anyway. Or
the system is generally slow and we get these warnings all the time. In the
latter case, let's not spam the log.

Fixes #533

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: add quirk for Dell Precision 7550/7750 touchpad
Scott Jann [Mon, 3 Aug 2020 05:03:59 +0000 (00:03 -0500)]
quirks: add quirk for Dell Precision 7550/7750 touchpad

Signed-off-by: Scott Jann <sjann@knight-rider.org>
3 years agoquirks: switch the models with missing buttonpad to use the new attr
Peter Hutterer [Fri, 23 Oct 2020 01:01:57 +0000 (11:01 +1000)]
quirks: switch the models with missing buttonpad to use the new attr

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: add AttrInputPropEnable and Disable
Peter Hutterer [Fri, 23 Oct 2020 00:38:14 +0000 (10:38 +1000)]
quirks: add AttrInputPropEnable and Disable

The latter requires libevdev 1.10 but since that'll take a while to filter
into our various CI systems, let's make it conditional.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: add AttrEventCodeEnable as counterpoint to the disable one
Peter Hutterer [Thu, 22 Oct 2020 23:14:33 +0000 (09:14 +1000)]
quirks: add AttrEventCodeEnable as counterpoint to the disable one

Currently unused, but let's get this in because we may need this very soon for
broken tablets.

Enabling EV_ABS axes requires an absinfo struct - we default to a simple 0-1
axis range for those as the most generic option. Anything more custom will
need more custom treatment when we need it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoevdev: localize two variables during quirks handling
Peter Hutterer [Fri, 23 Oct 2020 02:54:54 +0000 (12:54 +1000)]
evdev: localize two variables during quirks handling

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoevdev: quirks_get_tuples can deal with a NULL quirks
Peter Hutterer [Fri, 23 Oct 2020 02:53:35 +0000 (12:53 +1000)]
evdev: quirks_get_tuples can deal with a NULL quirks

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/debug-events: rework touch event printing
Peter Hutterer [Tue, 20 Oct 2020 23:06:16 +0000 (09:06 +1000)]
tools/debug-events: rework touch event printing

Previously, touch up events did not contain the slot number which makes the
logs ambiguous (e.g. see the one in #532). Fix that, and since doing so would
require extra conditions anyway get rid of the current with/without coords
function and just handle it all inside one function instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoPrint the event name when using an invalid event type
Peter Hutterer [Tue, 20 Oct 2020 23:01:32 +0000 (09:01 +1000)]
Print the event name when using an invalid event type

Where an invalid event type is passed to a function (e.g. a keyboard event to
a touch-related function) we used to only print the event code. That makes
debugging less obvious than necessary, so let's print the event name too.

This requires the function to be moved below event_type_to_str()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: fix the tip one axis test
Peter Hutterer [Thu, 8 Oct 2020 02:44:10 +0000 (12:44 +1000)]
test: fix the tip one axis test

Only worked because of axis smoothing mangling the coordinates - x is not
supposed to change where we're moving along a vertical line. And the same for
y and horizontal lines.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: fix the tablet relative calibration test
Peter Hutterer [Thu, 8 Oct 2020 02:27:37 +0000 (12:27 +1000)]
test: fix the tablet relative calibration test

This test only worked because axis smoothing mangled the coordinates, moving
from 5/10 to 10/20 cannot possibly have a dx of zero.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agofallback: expand the range of valid keys
Peter Hutterer [Tue, 6 Oct 2020 23:36:38 +0000 (09:36 +1000)]
fallback: expand the range of valid keys

The kernel has since added a bunch of keys in the range between
KEY_ONSCREEN_KEYBOARD and BTN_TRIGGER_HAPPY. Let's designate those as keys so
we handle them correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agogitlab CI: add git depth to the coverity job and save the artifacts
Peter Hutterer [Tue, 6 Oct 2020 06:43:52 +0000 (16:43 +1000)]
gitlab CI: add git depth to the coverity job and save the artifacts

A default git depth of 1 means git describe won't work, let's set it to
something high enough that we should always have at least one tag in the
history.

And save the artifacts after the coverity compilation, where the submission
fails for whatever reason we can just resubmit those manually without having
to rebuild the whole image locally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools: color-group the debugging messages
Peter Hutterer [Tue, 6 Oct 2020 06:03:19 +0000 (16:03 +1000)]
tools: color-group the debugging messages

Alternate between two randomly-chosen colors for each batch of debug messages
to make it easier to visually group the two.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools: print the libinput_dispatch() counter for debugging messages
Peter Hutterer [Tue, 6 Oct 2020 05:35:44 +0000 (15:35 +1000)]
tools: print the libinput_dispatch() counter for debugging messages

The messages with priority DEBUG refer to the various internal state machines
updating, so it's useful to know when they did so. Let's count up every time
we trigger libinput_dispatch() so we know how the messages group together.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools: only call libinput_dispatch() once per poll
Peter Hutterer [Tue, 6 Oct 2020 05:04:08 +0000 (15:04 +1000)]
tools: only call libinput_dispatch() once per poll

This is a closer approximation of all callers anyway, and it makes it easier
to debug which events are handled per libinput_dispatch() call.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: fix force-press on Apple Magic Trackpad 2
Davide Depau [Sat, 12 Sep 2020 15:21:59 +0000 (17:21 +0200)]
quirks: fix force-press on Apple Magic Trackpad 2

The current defaults detect force presses as palm or thumb.
The values provided here work for a 99% accurate palm/thumb detection
and provide close zero false positives in my tests.

Signed-off-by: Davide Depau <davide@depau.eu>
3 years agodoc/api: fix the doxygen output handling
Peter Hutterer [Tue, 29 Sep 2020 07:33:36 +0000 (17:33 +1000)]
doc/api: fix the doxygen output handling

Using output: ['.'] broke ninja after ninja clean - it removed the whole
directory and thus the meson-generated configure_files (i.e. all the
doxygen sources we copied). ninja didn't know how to build those.

Fix this by rearranging the doxygen output to build into a different
directory now and setting the output to that. This doesn't exactly *fix*
things since that directory is no longer removed during ninja clean, but at
least the build no longer fails.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: Customize ALPS i2c touchpad palm detect pressure threshold
Kai-Chuan Hsieh [Mon, 28 Sep 2020 02:43:28 +0000 (10:43 +0800)]
quirks: Customize ALPS i2c touchpad palm detect pressure threshold

ALPS i2c touchpad support ABS_PRESSURE and ABS_MT_PRESSURE capabilities,
The default threshold 130 is too easy to across while finger movement.
It will cause the cursor stalled after the threshold is achieved, which
impacts user experience.
Test with some ALPS touchpads 0488:101A, 0488:101D, 0488:101E, the value
180 is good on those platforms.

Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
3 years agodoc: update touchpad tapping state machine diagram
satrmb [Sun, 19 Jul 2020 21:46:01 +0000 (23:46 +0200)]
doc: update touchpad tapping state machine diagram

Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
3 years agotest: expand drag and multitap tests to tap with up to 3 fingers
satrmb [Wed, 1 Jul 2020 19:02:09 +0000 (21:02 +0200)]
test: expand drag and multitap tests to tap with up to 3 fingers

This covers the addition of two- and three-finger tap-and-drag,
as well as the fix for multitaps with more than one finger in later taps
and the multifinger enhancement to the tap ending drag-lock.

Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
3 years agotouchpad: fix multitaps with more than one finger while dragging is enabled
satrmb [Wed, 8 Jul 2020 11:32:43 +0000 (13:32 +0200)]
touchpad: fix multitaps with more than one finger while dragging is enabled

Also permits any number of fingers in the tap that terminates drag-lock.

Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
3 years agotouchpad: allow tap-and-drag for two-finger and three-finger taps
satrmb [Tue, 23 Jun 2020 22:20:57 +0000 (00:20 +0200)]
touchpad: allow tap-and-drag for two-finger and three-finger taps

This commit duplicates the tap states responsible for tap-and drag (TAPPED
and all DRAGGING* states) to cover two-finger and three-finger taps;
the code for the new states is shared with the existing machinery for
one-finger tap-and-drag.

Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
3 years agotouchpad: track the release of all fingers in a three-finger tap
satrmb [Wed, 1 Jul 2020 09:54:28 +0000 (11:54 +0200)]
touchpad: track the release of all fingers in a three-finger tap

This is in preparation for three-finger tap-and-drag, which will start from
a completed tap with no fingers down.

Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
3 years agotest: set the elan test device to always double up on tool bits
Peter Hutterer [Thu, 10 Sep 2020 23:54:24 +0000 (09:54 +1000)]
test: set the elan test device to always double up on tool bits

This is the device from
https://gitlab.freedesktop.org/libinput/libinput/-/issues/259 which sets
BTN_TOOL_PEN in addition to the real tool. Integrate this into the test device
proper so it always does this to catch various outliers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: move the x/y coords a bit when testing tool type switches
Peter Hutterer [Thu, 10 Sep 2020 23:31:20 +0000 (09:31 +1000)]
test: move the x/y coords a bit when testing tool type switches

More realistic, there's no way you can get the x/y coordinates exactly the
same when moving the pen back into prox.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: auto-assign the tool type for tablet tests
Peter Hutterer [Thu, 10 Sep 2020 22:43:58 +0000 (08:43 +1000)]
test: auto-assign the tool type for tablet tests

The current tool type test merely sends BTN_TOOL_RUBBER (and others) manually
and expects libinput to do the right thing. This only tests the perfect
sequence but not test weird devices that behave differently on a tool type
switch.

So let's fix this by setting the tool type as property on the libinput test
device itself, and then emulate the tool switch through litest.
For special devices this will need extra callbacks, this is just the initial
framework to handle those buttons.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotablet: split a ternary condition into a normal if else for readability
Peter Hutterer [Thu, 10 Sep 2020 22:42:15 +0000 (08:42 +1000)]
tablet: split a ternary condition into a normal if else for readability

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: don't run the tool switch test on tablets that require forced prox out
Peter Hutterer [Thu, 10 Sep 2020 22:39:52 +0000 (08:39 +1000)]
test: don't run the tool switch test on tablets that require forced prox out

This test only worked because we're emulating events that the device never
sends that way. Just skip the test, devices that require a forced prox out
probably don't handle (or even have) erasers ayway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotest: remove duplicate tool type
Peter Hutterer [Thu, 10 Sep 2020 05:41:01 +0000 (15:41 +1000)]
test: remove duplicate tool type

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotablet: group the pressure related bit into a substruct
Peter Hutterer [Wed, 9 Sep 2020 02:54:32 +0000 (12:54 +1000)]
tablet: group the pressure related bit into a substruct

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/record: compress a set of printfs into one
Peter Hutterer [Thu, 17 Sep 2020 02:31:29 +0000 (12:31 +1000)]
tools/record: compress a set of printfs into one

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/record: prefix the device list with a # character
Peter Hutterer [Thu, 17 Sep 2020 01:08:59 +0000 (11:08 +1000)]
tools/record: prefix the device list with a # character

Too many recordings end up with the device list at the top when users redirect
stderr and stdout to the recordings file. This breaks yaml parsing and
requires manual removal of the first few lines.

Avoid this by prefixing the lines with a command character, this way the yaml
stays correct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotools/record: add --grab option
Peter Hutterer [Sun, 13 Sep 2020 21:58:04 +0000 (07:58 +1000)]
tools/record: add --grab option

Useful to record devices like power buttons, lid switches, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agocheck return value for libudev/udev_monitor_filter_add_match_subsystem_devtype
weizhixiang [Tue, 15 Sep 2020 08:03:44 +0000 (16:03 +0800)]
check return value for libudev/udev_monitor_filter_add_match_subsystem_devtype

Signed-off-by: weizhixiang <1138871845@qq.com>
3 years agoremove extra parameter in path_disable_device()
weizhixiang [Wed, 16 Sep 2020 05:13:34 +0000 (13:13 +0800)]
remove extra parameter in path_disable_device()

Signed-off-by: weizhixiang <1138871845@qq.com>
3 years agocheck return value for udev_new()
weizhixiang [Tue, 15 Sep 2020 02:23:38 +0000 (10:23 +0800)]
check return value for udev_new()

Signed-off-by: weizhixiang <1138871845@qq.com>
3 years agotools/replay: check the recorded udev properties against the local properties
Peter Hutterer [Wed, 9 Sep 2020 00:50:42 +0000 (10:50 +1000)]
tools/replay: check the recorded udev properties against the local properties

Where a device is replayed locally for testing, its udev properties should
match the recorded properties. Otherwise the testing results will not be
reliable.

The exception here is the device group which we currently don't set for
emulated devices and even if we did, it may intentionally differ anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agomeson.build: add a few compiler warnings and make them compiler-conditional
Peter Hutterer [Wed, 9 Sep 2020 01:53:12 +0000 (11:53 +1000)]
meson.build: add a few compiler warnings and make them compiler-conditional

These seem like a decent-enough set to have, only -Wlogical-op actually
produced a new warning.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agotimer: fix a logic error checking the list node
Peter Hutterer [Wed, 9 Sep 2020 01:56:54 +0000 (11:56 +1000)]
timer: fix a logic error checking the list node

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agoquirks: fix a logical error checking for A..Z
Peter Hutterer [Wed, 9 Sep 2020 01:55:57 +0000 (11:55 +1000)]
quirks: fix a logical error checking for A..Z

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
3 years agomeson.build: drop the separate cpp flags
Peter Hutterer [Wed, 9 Sep 2020 01:42:17 +0000 (11:42 +1000)]
meson.build: drop the separate cpp flags

All we care about for C++ is that we build.

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