Commit graph

253 commits

Author SHA1 Message Date
Peter Hutterer
61e41df901 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>
2021-02-08 03:38:26 +00:00
Peter Hutterer
affc3d929a libinput 1.16.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-01 19:14:10 +10:00
Peter Hutterer
ff598741a9 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>
2021-01-29 08:06:53 +10:00
Peter Hutterer
53595cb232 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>
2021-01-14 13:42:59 +10:00
Peter Hutterer
e882bd0216 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>
2020-10-23 13:35:50 +10:00
Peter Hutterer
e3c4ff3898 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>
2020-10-23 13:35:50 +10:00
Peter Hutterer
f86d6a6e5a 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>
2020-09-09 13:57:39 +10:00
Peter Hutterer
c6f87ade84 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>
2020-09-09 13:57:39 +10:00
Peter Hutterer
ad2216b4c8 meson.build: bump minimum version to 0.47
It's been out for 2 years.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 12:36:28 +10:00
Peter Hutterer
5201ed8cc6 meson.build: update libwacom dependency to 0.27 or newer
Released in 2017, that's enough waiting

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 12:36:09 +10:00
Peter Hutterer
a62e2b14a2 Drop the trailing slash from the HTTP_DOC_LINK
It makes the printf statements nicer and we ne don't use it on its own
anywhere anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 11:36:07 +10:00
Peter Hutterer
d007a8155b meson.build: we no longer install a hwdb file, so drop the directory define
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 11:36:07 +10:00
Peter Hutterer
9fa57c6ef7 meson.build: drop a meson < 0.43 condition
We require meson 0.45, so this can no longer be triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 11:36:07 +10:00
Peter Hutterer
852f7f8e03 meson.build: bump to 1.16.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 11:36:07 +10:00
Peter Hutterer
9dbfc700fe libinput 1.16.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-13 12:05:58 +10:00
Peter Hutterer
6d1f2f88d6 test: add two test devices for the false joystick labelling
Two devices that were affected by the regression fixed with #517

Test devices taken from:
https://gitlab.freedesktop.org/libinput/libinput/-/issues/514
https://gitlab.freedesktop.org/libinput/libinput/-/issues/515

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-13 11:02:33 +10:00
Peter Hutterer
af6fed94d8 libinput 1.16.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-03 15:37:49 +10:00
Peter Hutterer
13c3b008d0 libinput 1.15.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-27 15:36:24 +10:00
Peter Hutterer
c9ff7e78d9 libinput 1.15.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-15 09:36:48 +10:00
Peter Hutterer
f15da0f108 meson.build: don't install the quirks in a further 'quirks' subdirectory
install_subdir() by default also copies the 'quirks' directory, resulting in
the quirks files being in <datadir>/libinput/quirks/*.quirks as opposed to the
previous <datadir>/libinput/*.quirks.

Fixes 727dc44b04

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-01 10:57:20 +10:00
Peter Hutterer
727dc44b04 meson.build: use install_subdir() to install the quirks files
This removes the need to check whether the files were added in meson.build but
requires litest to traverse the source dir now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-17 07:52:00 +00:00
Peter Hutterer
4cf4aba3fb evdev: filter unreliable tablet mode switch events
If we know that the tablet mode switch is bogus anyway, filter the event and
don't pass it to the caller. They won't know whether it's bogus so the only
result we get here is buggy behaviour.

This is the simplest solution here, it filters the mode switch at the lowest
level and thus the caller won't know that the tablet even has a mode switch at
all. Where the device doesn't have any other switches it'll also lose the
switch capability.

This may cause issues in some niche cases where the event node only has
that one bit and we now disabled it leaving us with a zero-event bit device.
Shouldn't matter to callers, but let's see.

Fixes #491

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-03 22:32:56 +00:00
Evan Goode
034226d904 Allow the flat acceleration profile for touchpads
Signed-off-by: Evan Goode <mail@evangoo.de>
2020-05-27 06:21:00 +00:00
Peter Hutterer
4a9d3e8796 tools: add a measure touchpad-size tool
Replacement for the touchpad-edge-detector tool with a slightly more
expressive design, hopefully cutting down on some of the bug reports.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-30 15:14:45 +10:00
Martin Cihlář
4d42e9b9e2 add trust mouse quirk #455
Signed-off-by: Martin Cihlář <martin.cibule@seznam.cz>
2020-03-22 12:07:51 +01:00
Peter Hutterer
7814bcfed0 meson.build: bump to 1.15.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-22 10:51:01 +10:00
Peter Hutterer
b35a32dd9d man: install the analyze per-slot-delta man page
And add libinput analyze to the main libinput man page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-20 16:10:11 +10:00
Peter Hutterer
d0eb8d58a3 tools: switch tool option parsing test to use pytest
pytest is more powerful than unittest, so let's switch to that instead. And in
the process fix a few tests that for some reason succeeded even though they
shouldn't have (e.g. the autorestart test).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-17 10:08:48 +10:00
Peter Hutterer
e11bad41f5 tools: add a libinput analyze command with the per-slot-delta subcommand
I've been using this script ever since libinput record was available, might as
well ship it with libinput so I don't have to remember where it lives.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-16 08:35:43 +10:00
Peter Hutterer
a1c8909337 libinput 1.15.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-06 13:23:38 +10:00
Peter Hutterer
a3fb9bd7db libinput 1.15.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-20 11:21:16 +10:00
Peter Hutterer
0dcb02d369 test: add a test case for checking EVDEV_ABS overrides
Problem: it's still not a 100% check because the way real udev handles the
EVDEV_ABS overrides ignores any that are set through udev properties only. So
we manually have to trigger the keyboard builtin for our test device which
can give us false positives (e.g. it wouldn't have detected #424). But still,
it'll alert us if the actual overridden values are different to what we
expect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-12 21:22:01 +10:00
Peter Hutterer
ac2cfea5d2 libinput 1.15.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-03 14:28:44 +10:00
Peter Hutterer
71830dd460 tablet: fix the handling of axis updates after a forced proximity out
Where a pen was forced out of proximity and an eraser came into proximity
without axis updates on the prox-in, subsequent axis updates would trigger the
pen back into proximity. This resulted in two tools in proximity at once
though the new pen never went out of proximity

This would trigger crashes in various compositors/applications, see
https://github.com/xournalpp/xournalpp/issues/1141#issuecomment-578362497

The cause was a wrong condition introduced in ffd8c71e4e. We only need to
force the pen bit on if the current tool state is currently zero and no tool
update was sent with the axis event. In our case, the tool state is nonzero
already (eraser) and we can skip this bit.

Fixes #418

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-02 23:46:14 +00:00
Peter Hutterer
eb6ef9fe70 touchpad: correct a wrong slot count by the kernel
alps.c hardcodes 5 slots in the kernel but some devices only provide 2 slots
plus BTN_TOOL_TRIPLETAP, etc. Fix this by counting active slots and when the
fake finger count exceeds the active slots but is still less than the number
of slots, adjust the slots themselves downwards.

And because the new test device messes with our slot count assumptions for the
various tests hardcode that one device to return 2 slots.

Fixes #408

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-29 15:58:49 +10:00
Peter Hutterer
4d15fdf3e8 libinput 1.15.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-03 16:44:03 +10:00
Peter Hutterer
565f9470ff meson.build: re-add missing trailing slash to the HTTP link
Got lost in 61f81ec93e

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-23 10:57:53 +10:00
Anatolii Lishchynskyi
970b5aff59 quirks: ignore mode switch button on Madcatz R.A.T.3 mouse
Avoid stuck buttons, so window managers won't behave buggy, for example:
* You click on one window, but click is emulated in another one
* You hover cursor over button/link but see no feedback
Based on quirk for Cyborg mouse.

Signed-off-by: Anatolii Lishchynskyi <iamnotacake@protonmail.com>
2019-12-11 09:45:49 +00:00
Peter Hutterer
8f0af85072 libinput 1.14.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-05 13:50:24 +10:00
Peter Hutterer
3ac525db19 test: write our test case results out as junit xml files
libcheck has the ability to write out XML files for test results, but
converting those into junit isn't ideal, for a number of reasons:
- junit xml is different to libcheck's xml, so not all data is available or
  useful. Especially with our litest wrappers around it.
- litest forking off tests means we have to wrap around everything anyway to
  avoid multiple forks writing to the same test file.

This is the minimal implementation since it's only user is likely the CI which
we control fairly tightly. So there are a few corners we can skip:
- no filename validation is performed by litest
- we write out a lot of junit xml files (one per litest fork). Rather than
  collating those we just rely on the CI to find the files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-28 11:52:54 +01:00
Peter Hutterer
47767290a7 tools: print the libinput version in debug-events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-27 15:16:30 +10:00
Peter Hutterer
5dc1a7ebd3 Adjust for 64bit time_t for 32bit architectures
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-26 15:11:44 +10:00
Peter Hutterer
733eb07eda tools: add a tablet debugging tool
Nothing sophisticated but easier to debug certain tablet oddities.
It shows a bar for each axis on the tablet (and the evdev axis) and prints
that relative to the axis range. This makes it easy to check if we do hit the
full range (especially for distance/pressure/tilt) and whether that matches
with what the device gives us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-19 09:56:14 +10:00
Peter Hutterer
3205c29c60 meson.build: drop the explicit -g flag
Let's rely on meson to set this for us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-06 11:48:49 +10:00
Peter Hutterer
bdd798778a test: remove the hardcoded four-job valgrind test run
Make this dependent on the number of processes too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-05 00:54:32 +00:00
Peter Hutterer
61f81ec93e meson: move HTTP doc url generation to here
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-17 08:31:28 +00:00
Tadeo Kondrak
0e19d2c329
meson.build: fix building as a subproject 2019-10-07 01:04:21 -06:00
Peter Hutterer
7126823fe1 meson.build: bump to 1.14.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-12 11:10:34 +10:00
Peter Hutterer
e7a9c07ffe udev: parse the EVDEV_ABS properties for a potential fuzz setting
Where a fuzz is defined in the 60-evdev.hwdb, we rely on a udev builtin to
set the kernel device to that fuzz value. Unfortunately that happens after our
program is called with this order of events:
1. 60-evdev.rules calls IMPORT(builtin) for the hwdb which sets the EVDEV_ABS_*
  properties. It also sets RUN{builtin}=keyboard but that's not invoked yet.
2. 90-libinput-fuzz-override.rules calls IMPORT{program} for our fuzz override
  bits. That sets the kernel fuzz value to 0 and sets the LIBINPUT_FUZZ_*
  propertie
3. The keyboard builtin is run once all the rules have been processed.

Our problem is that where the fuzz is set in a hwdb entry, the kernel fuzz is
still unset when we get to look at it, so we always end up with a fuzz of zero
for us and a nonzero kernel fuzz.

Work around this by checking the EVDEV_ABS property, extracting the fuzz from
there and re-printing that property without the fuzz. This way we ensure the
kernel remains at zero fuzz and we use the one from the hwdb instead.

Fixes #346

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:24:02 +10:00
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