Commit graph

5269 commits

Author SHA1 Message Date
Peter Hutterer
1de6ac8916 test: rename the 12WX test device short name and enum
Make this more specific, we have quite a few other cintiqs in here

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1143>
2025-02-25 05:18:53 +00:00
Peter Hutterer
f70f803365 quirks: add quirk for the RazerBlade182024 Keyboard
Generated by tools/razer-quirks-lister.py

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1148>
2025-02-24 08:56:02 +00:00
satrmb
a71f560f3e test: fix off-by-ones in two ranges, prevent the same in remaining ranged tests
touchpad_move_after_touch contains support for up to 5 fingers but was only run
with 2..4 fingers.
touchpad_multitap and several others using the same parameter definition were
long ago tested with 3..7 taps. In 8f92b091 this was reduced to 3..4 for CI
performance, while the commit message indicates 3..5 were intended.

The common theme is that the upper bound of `struct range` is interpreted
as exclusive, while some uses assumed it would be inclusive.
There are relatively recent helper functions range_init_inclusive and
range_init_exclusive (since 817dc423) to avoid this trap. Use them on the
remaining two ranged tests.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1142>
2025-02-20 09:34:20 +01:00
satrmb
6f9a54c573 test: convert most ranged tests to parametrized ones
The two remaining ranged tests (abs_device_no_range, abs_mt_device_no_range)
are better served staying with ranges because parametrized tests need to
explicitly list all members of the range, which for these tests is not only
pretty big, but also contains abs axes reserved for future use. Those axes
have no names yet, making a future-proof conversion pretty much impossible.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1142>
2025-02-20 09:34:14 +01:00
satrmb
3a60c47e33 test: add optional value names to parametrized tests
Only implemented for i32 values so far, used for enums and enum-like constants,
replaces a runtime lookup from stringly-typed parameters.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1141>
2025-02-20 08:18:48 +01:00
Peter Hutterer
bf3a67de6c gestures: if 3fg drag fingers are in a nice position, start dragging
Similar to the condition just north of here, if we have 3 fingers in a
roughly linear line and 3fg dragging is enabled, assume we're actually
trying to drag. This reduces the minimum movement otherwise required
to detect the type of gesture.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042>
2025-02-18 06:44:01 +00:00
Peter Hutterer
1d9e307e2b touchpad: implement support for three-finger drag
Exposed via new configuration option this enables 3 and 4 finger
dragging on touchpads. When enabled a 3/4 finger swipe
gesture is actually a button down + motion + button up sequence.

If tapping is disabled the drag starts immediately, if tapping is
enabled the drag starts after the tap timeout/motion so we can distinguish
between a tap and a drag.

When fingers are released:
- if two fingers remain -> keep dragging
- if one finger remains -> release drag, switch to pointer motion

When 3/4 fingers are set down immediately after releasing all fingers
the drag continues, similar to the tap drag lock feature. This drag lock
is not currently configurable.

This matches the macos behavior for the same feature.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042>
2025-02-18 06:44:01 +00:00
Peter Hutterer
ae86d8b1b6 gestures: disambiguate between a tap timeout and a hold timeout
Where the tapping code calls into the timeout function make sure we have
a separate event for this. This way we know whether the current gesture
event is caused by the hold timeout or something else.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042>
2025-02-18 06:44:01 +00:00
Peter Hutterer
659b49b3a3 gestures: localize a set of variables better
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042>
2025-02-18 06:44:01 +00:00
Peter Hutterer
16a8c1d06c gestures: rename a helper function
has_started() is a bit misleading here, this merely decides whether we
should delay any finger changes or not.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042>
2025-02-18 06:44:01 +00:00
Peter Hutterer
c73fc78407 touchpad: cancel any ongoing gesture if we're about to send a button
This shouldn't have any effect in the current setup as there is
"coincidentally" no overlap between the two state machines so this is
effectively a noop.

Nonetheless, if we're about to send a tap button event we cannot be in
any other gesture than tapping so all swipe/pinch/holds need to be
cancelled.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042>
2025-02-18 06:44:01 +00:00
Peter Hutterer
114af53824 test: fix the touchpad finger positions for a test
The 5th finger was placed in the same position as the 4th finger which
doesn't have an effect in libinput but it looks wrong.

And the first finger was put down at 40/30 but then moved from 70/30 to
the new position, causing pointer jumps on some touchpads.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1145>
2025-02-18 05:40:44 +00:00
Peter Hutterer
5ae31d7f46 test: fix litest_test_param_get_double
Overenthusiastic search/replace caused the name argument to be a const
double*.

Fixes: 5ed75e7e9f ("test: make litest_parameters fetching more type-safe")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1144>
2025-02-18 14:58:28 +10:00
Peter Hutterer
9d214e1c19 tools/list-devices: add missing config options to the output
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1140>
2025-02-17 07:59:05 +00:00
Peter Hutterer
d33c83b1b1 tools/list-devices: add helper to print aligned values
This makes it easier to re-align all columns.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1140>
2025-02-17 07:59:05 +00:00
Peter Hutterer
c8ee24ce17 tools/list-devices: reword the man page a bit
Hopefully a slightly better explanation that what we had before.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1140>
2025-02-17 07:59:05 +00:00
Peter Hutterer
dbe8f7fede tools/list-devices: allow listing some devices only
$ libinput list-devices /dev/input/envent0

Now does what one would expect.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1140>
2025-02-17 07:59:05 +00:00
wangyafei
3cf6c91fff quirks: add quirks for Dell laptop with Goodix Touchpad.
This touchpad is a pressure pad and needs the pressure
handling disable.

Signed-off-by: Charles Wang <charles.goodix@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1130>
2025-02-13 02:18:02 +00:00
Peter Hutterer
5ed75e7e9f test: make litest_parameters fetching more type-safe
Require the type to be added in the litest_test_params_fetch() so we can
easily detect a mismatch. And add some type-safe getters that are much
easier to use for all the tests that only have a single parameter to
fetch anyway.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1139>
2025-02-12 09:11:51 +00:00
Peter Hutterer
9ae15c6a45 pad: be more robust to kernel bugs of multiple EV_ABS
This is a workaround for a kernel bug with the Wacom Mobile Studio Pro
13: this device sends erroneous ABS_WHEEL events when pressing
buttons:

  - evdev:
    - [  0,      0,   1, 256,       1] # EV_KEY / BTN_0                     1
    - [  0,      0,   3,   8,      17] # EV_ABS / ABS_WHEEL                17 (+17)
    - [  0,      0,   3,   8,       0] # EV_ABS / ABS_WHEEL                 0 (-17)
    - [  0,      0,   3,  40,      15] # EV_ABS / ABS_MISC                 15 (+15)
    - [  0,      0,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +0ms

ABS_WHEEL to 17 then to 0 in the same frame. We should (and do) treat this
as a zero event and drop the 17 to the floor. Alas, we then generate a
ring event for the zero value despite our current value being zero
anyway. This again causes confusing behavior.

This is simple enough to work around, at least until the kernel is fixed
but also to prevent this happening in the future: warn if we get
multiple events and if so and the later event is zero, undo the axis
change state.

Closes: #1081
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1136>
2025-02-12 03:58:23 +00:00
Peter Hutterer
d9f121b4d1 test: add a litest_with_parameters helper macro
Magic for loop that takes care of the creation and unref for us,
hopefully improving readability a bit.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1138>
2025-02-12 11:41:56 +10:00
José Expósito
b566d64c17 quirks: Add Apple Magic Trackpad v2 USB-C (2024)
Add the missing USB-C vendor ID.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1080
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1134>
2025-02-04 14:36:01 +01:00
Peter Hutterer
184bcafe08 triage-policies: update to handle a few more things in MRs as well
Requesting libinput record, hid-recorder or punting to udev-hid-bpf
should be possible from MRs as well.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1133>
2025-02-03 09:16:02 +10:00
José Expósito
3f4abaf77e quirks: Add Apple Magic Trackpad v2 2024
Add similar quirks to the previous generations.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1080
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1131>
2025-01-29 09:32:30 +01:00
José Expósito
e74d174744 quirks: Disable MT_TOOL_PALM for the Yoga Slim 7i Carbon
Lenovo Yoga Slim 7i Carbon sends bogus ABS_MT_TOOL_TYPE MT_TOOL_PALM
events. Disable them.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1077
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1128>
2025-01-21 10:16:47 +00:00
Marge Yang
af0e9a23c3 quirks: add quirk for Dell Haptics Touchpad.
This Touchpad is a pressure pad and needs the pressure
handling disable.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1127>
2025-01-21 07:26:41 +00:00
Peter Hutterer
fefeab4efe test: a boolean parameter is always true/false
Don't require the caller to provide the values, they're always the
same.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1123>
2025-01-20 12:08:46 +00:00
Peter Hutterer
86b9142a02 test: highlight the interesting part of the backtrace
This makes it easier to immediately see where things are breaking since
the full backtrace has >70% noise.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1124>
2025-01-20 11:30:01 +00:00
Peter Hutterer
6759a2f754 test: honor NO_COLOR and FORCE_COLOR for output colorization
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1124>
2025-01-20 11:30:01 +00:00
Peter Hutterer
74617de48d tools/record: record HID_BPF properties too
If this property is set we likely have a udev-hid-bpf property
loaded into the device. Knowing this is going to be important for
debugging why a device may or may not work so let's record this.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1121>
2025-01-20 10:29:47 +00:00
Peter Hutterer
2c0c4a6516 Replace strneq() with hardcoded lengths with strstartswith()
Slightly less efficient but easier to read and it's not possible to
accidentally provide the wrong length. Plus it handles null pointers
correctly so get to skip the checks (which weren't needed for strneq()
either, but still).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1121>
2025-01-20 10:29:47 +00:00
Kirill Primak
00bc910df7 tablet: add missing event types in tool/pad event docs
Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1126>
2025-01-20 10:08:36 +00:00
Peter Hutterer
1d8f2903ed tablet: always unset the various statuses if we're leaving proximity
The previous invocation was gated behind a TABLET_OUT_OF_AREA check
resulting in a nonresponsive tool when the tablet was moved out of
proximity outside the tablet area and the area was changed.

Move the actual status bit changes up into tablet_flush()
so we unconditionally set those.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1118>
2025-01-20 09:54:32 +00:00
Peter Hutterer
2f2612e8d7 test: use litest_checkpoint to annotate a test case
Had to debug something here and we might as well keep the printable
annotations.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1118>
2025-01-20 09:54:32 +00:00
Peter Hutterer
55d47903b4 test: switch the tablet tests to parametrized tests
No functional change but the tests now include the parameters in
easy-to-read fashion which makes it easier to figure out which
combination is failing.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1118>
2025-01-20 09:54:32 +00:00
Peter Hutterer
c3bf478d41 util: add truefalse and yesno macros for easy string conversion
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1118>
2025-01-20 09:54:32 +00:00
Peter Hutterer
d52bb9ed4d tools/per-slot-delta: optionally show the distance to the original point
This makes it easier to quickly gather how far a touch has moved since
it started, compared to the initial starting position. This again makes
it easier to determine if a threshold required for e.g. scrolling has
been met.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101>
2025-01-09 02:12:10 +00:00
Peter Hutterer
5f8f715017 tools/per-slot-delta: refactor the printing of a slot
This makes it easier to optionally print extra components of that slot.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101>
2025-01-09 02:12:10 +00:00
Peter Hutterer
5df1d26aa2 tools/per-slot-delta: use a Point class for slot position/delta
Better abstraction, especially when we introduce more than just those
two.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101>
2025-01-09 02:12:10 +00:00
Peter Hutterer
a7ff3e0508 tools/per-slot-delta: remove some duplication for axis handling
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101>
2025-01-09 02:12:10 +00:00
Peter Hutterer
01f133fbc4 tools/per-slot-delta: use dataclasses and enums
Slight modernization of the code

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101>
2025-01-09 02:12:10 +00:00
Peter Hutterer
530ca423a7 Improve the event queuing debugging a bit
Print a bit more information if this ifdef is disabled for
debugging, in this case for button events. That's all
I need for now, we can extend later.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1122>
2025-01-09 11:36:32 +10:00
Peter Hutterer
5388299117 test: slightly improve the failure message for litest_assert_not_null
Now prints
        FAILED: ev != NULL
which is less ambiguous/confusing than the previous
        FAILED: ev expected to be not NULL

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1122>
2025-01-09 11:36:26 +10:00
Peter Hutterer
d9de017d6c test: fix --filter-params handling
The previous implementation skipped parameters that were filtered, so
our test cases got called with parameters missing. Fix this by filtering
any test case that has a negative fnmatch on any parameter.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1120>
2025-01-08 10:18:31 +00:00
Peter Hutterer
11dec0bd9b test: switch touchpad button tests to use parameters
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1119>
2025-01-08 11:59:14 +10:00
Peter Hutterer
6ee8e8d9b6 test: change tap tests to use parameters
This also fixes the invocation of the
touchpad_3fg_tap_btntool_pointerjump which was written as ranged test
but never got invoked with a range (but _i defaults to zero).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1119>
2025-01-08 10:50:52 +10:00
Peter Hutterer
4bbad8adf0 test: change switch tests to use parameters
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1119>
2025-01-08 10:48:32 +10:00
Peter Hutterer
812611ca2e test: switch touchpad tests to use parameters
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1119>
2025-01-08 09:21:01 +10:00
Peter Hutterer
44fecb9a98 doc/user: link to the explanation why we can't change the tap default
We don't have an API for "device really should have tapping enabled" so
right now the only indicator of whether that's the case is when the
device has tapping enabled by default. This kind of prevents us from
switching the default, so let's at least link to the comment explaining
this.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1115>
2025-01-07 09:10:50 +00:00
Peter Hutterer
800eeaea7e test: change the x/y type from int to double in a helper
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1117>
2025-01-07 13:04:30 +10:00