Commit graph

5214 commits

Author SHA1 Message Date
Peter Hutterer
da296c9976 util: Add a multivalue special type
A stripped down version of e.g GVariant that's enough for the few
parameter types we need to support.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1109>
2025-01-07 02:02:37 +00:00
Peter Hutterer
5e5799a319 test: log litest_checkpoint to stderr
Otherwise the logs are detached from libinput's logs (which are printed
to stderr) which makes the checkpoint function mostly useless since it
doesn't actually group the messages as expected.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1116>
2025-01-07 11:40:00 +10:00
Peter Hutterer
9ac040f72a util: add etrace to trace to stderr
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1116>
2025-01-07 11:40:00 +10:00
Peter Hutterer
3aa004b964 libinput 1.27.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2025-01-06 15:04:14 +10:00
Peter Hutterer
e68d80b13b CI: bump to Fedora 41
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1111>
2024-12-23 07:17:31 +00:00
Peter Hutterer
b1f804c5f1 Fix two scan-build warnings that appear on F41
../../../src/util-files.h:61:3: warning: The 1st argument to 'close' is <= -2 but should be >= -1 [unix.StdCLibraryFunctions]
   61 |                 close(*fd);

 ../../../test/test-quirks.c:66:8: warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker]
   66 |                 rc = fputs(file_content, fp);

The latter is bogus because we have a litest_assert for this but
somehow this is ignored, so... shrug.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1111>
2024-12-23 07:17:31 +00:00
Peter Hutterer
117d91b93f tools/libinput-replay: use list comprehension instead of append
And remove the unnecessary del processes, we're in a block so processes
ceases to exist there anyway.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1102>
2024-12-22 23:59:22 +00:00
Peter Hutterer
193aacf61a tools/libinput-replay: interrupt only the ongoing event sequence with ctrl+c
If libinput replay is currently replaying events, stop that sequence and
go back to the start if the user presses Ctrl+C. Only on the second
Ctrl+C do we fully exit.

This helps debugging long recordings where we don't want to keep
producing events after some initial event sequence.

Closes #1064

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1102>
2024-12-22 23:59:22 +00:00
WeirdTreeThing
a03058db72 quirks: Add quirk for Google Chromebook Banshee
Signed-off-by: Brady Norander <bradyn127@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1108>
2024-12-20 16:41:16 -05:00
Peter Hutterer
0288781383 gestures: change the debug log messages for state debugging
Prefix the result of handle_event with "event" and the handle_state with
"state"

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1106>
2024-12-20 09:47:46 +00:00
Peter Hutterer
3563b6780f gestures: use a macro for debugging transition states
This avoids bugs where we forget to update a state but also provides
some bounds checking now to ensure our array is large enough to store
those transitions.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1106>
2024-12-20 09:47:46 +00:00
Peter Hutterer
2e9d8df74e tools/debug-gui: color the fingers with different colors
Follow-up to commit 713892c162 ("Number the fingers by slot in debug-gui")
this changes the colors slightly for each finger, making it easier to
track visually.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1103>
2024-12-20 01:15:11 +00:00
Peter Hutterer
4131e4d2c0 quirks: the Wacom Bamboo 2FG 6x8 is a semi-mt touchpad
See #919

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1104>
2024-12-20 00:43:50 +00:00
Peter Hutterer
3b2ff75a0d triage-policies: fix the hwdb.d directory
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1100>
2024-12-19 07:27:23 +00:00
Peter Hutterer
632b6dad63 triage-policies: add an entry to punt to udev-hid-bpf
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1105>
2024-12-19 07:17:06 +00:00
Joshua Noeske
ce7b7c94e7 gestures: fix transformation of scroll to pinch
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1099>
2024-12-18 15:50:50 +01:00
Peter Hutterer
d63689003f tools: only warn once about our lack of support for multiple fingers
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1096>
2024-12-18 08:49:34 +00:00
Peter Hutterer
eef0650759 touchpad: init the thumb size threshold to INT_MAX
For consistency with the pressure threshold, both are guarded behind
a use_size/use_pressure boolean anyway.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1095>
2024-12-18 08:24:41 +00:00
Peter Hutterer
52679e1296 tools/libinput-replay: print a separator line for EV_SYN events
If running with --verbose having that line makes it a lot easier to
look at the event sequence.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1094>
2024-12-18 08:07:18 +00:00
Peter Hutterer
f44a181a8e triage-policies: default close after pointing the user to 60-evdev.hwdb
In line with our new process of closing bugs let's close after this
bugbot message too. If the hwdb doesn't fix it then the reporter can
always re-open.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1097>
2024-12-18 07:39:57 +00:00
Peter Hutterer
c6c0db1d8d triage-policies: add missing "actions" for the bugbot::evdev-hwdb
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1098>
2024-12-18 11:12:23 +10:00
Peter Hutterer
a5b94ed79c triage-policies: update the bugbot::close wording and link to the wiki
Now that we have a wiki page let's link to it, it has all the details
on how and why we (plan to) do this.

Also change the wording to be make it easier to anthropomorphize bugbot
when it adds that comment, ideally leading to fewer grumpy users.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1093>
2024-12-16 07:20:55 +00:00
Salvo 'LtWorf' Tomaselli
2f9c173e72 Add examples with other thresholds to the documentation
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1092>
2024-12-16 11:17:22 +10:00
Peter Hutterer
bdbaea6162 triage-policies: add missing actions line
Fixes: 85ec33f802 ("triage-policies: add a bugbot command for closing bugs")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1091>
2024-12-11 18:57:29 +10:00
Peter Hutterer
85ec33f802 triage-policies: add a bugbot command for closing bugs
We have labels like needinfo or triage needed but all these labels
require intervention from a privileged user - normal users cannot
set labels on a project.

The only thing users can all do is open/close/re-open bugs. So let's try
to incorporate this into our event flow: if we need something from the
user we ask for it, close the bug and when the user supplies this
information they can re-open it. This means e.g. bugs waiting forever in
triage will not show up as actionable in the issue list.

Since users aren't used to that workflow let's add a bugbot blurb that
explains that we're not really closing the issue, just using that as the
only lever we have available.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1090>
2024-12-11 14:45:51 +10:00
Peter Hutterer
9988f4242e tools/measure-touchpad-pressure: require max > min for a range
Otherwise a resulting quirk will fail when parsed by libinput which
enforces this too.

Closes #1060

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1089>
2024-12-10 10:00:39 +00:00
Peter Hutterer
c3aa00ef90 gestures: don't handle SWIPE if we transitioned from SWIPE_START
If we get to SWIPE_START we send out the BEGIN event and transition to
state SWIPE. We must not process that state immediately to avoid sending
out a spurious UPDATE event when nothing has changed.

Same for the PINCH_START/PINCH and SCROLL_START/SCROLL states.

This also fixes a crasher where we end up with NaN in the custom
acceleration function because passing the same timestamp in twice causes
a division by zero (delta time is zero).

Closes #1053

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1088>
2024-12-10 06:15:21 +00:00
andeston
84225f28b6 pre-commit-hooks v5.0.0
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1086>
2024-12-04 02:02:12 -05:00
andeston
2fa31f68b3 ruff-pre-commit v0.8.1
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1086>
2024-12-04 02:02:12 -05:00
andeston
c65e0e2a06 Update b2c sha
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1086>
2024-12-04 02:02:12 -05:00
Peter Hutterer
3b85a4017d CI: update to latest ci-templates
This allows for gitlab private emails in commit messages.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1087>
2024-12-03 23:11:59 +00:00
Peter Hutterer
d773056d2e touchpad: remove assert that may trigger during a race condition
There appears to be a race condition where an ABS_MT_TRACKING_ID -1
event is on the wire but libevdev_fetch_slot_value() for that slot
already gives us -1 as well.

If we just (re)opened our device, synching our slots would thus set zero
active slots and then trigger the assert when that event is being
processed.

It's unclear how to reliably reproduce this issue but removing the
assert and simply ignoring this event if we don't have active slots
is correct anyway.

Closes #1050

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1081>
2024-12-01 22:44:50 +00:00
Mingcong Bai
5915ac45dd quirks: lower AttrTrackpointMultiplier for ThinkPad X200s/201s to 0.25
Follow commit 65b53f82ff ("quirks: lower AttrTrackpointMultiplier for
ThinkPad X200/201 to 0.25") and lower this multiplier for Lenovo ThinkPad
X200s/201s models, as I found the identical issue as the one previously
quirked for ThinkPad X200/201.

Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1084>
2024-12-01 22:58:01 +08:00
xzl
ab385a5d5f quirks: add pressure pad quirk for Lenovo ThinkBook 14 G6+ IMH
The ThinkBook 14 G6+ IMH also has the same issue as the ThinkBook 14 G7+ ASP.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1083>
2024-11-28 15:41:42 +08:00
Peter Hutterer
64d1f198fb libinput 1.27.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-11-19 13:41:39 +10:00
Mingcong Bai
65b53f82ff quirks: lower AttrTrackpointMultiplier for ThinkPad X200/201 to 0.25
Upstream commit 43cd2cbf83 ("data: add the dell trackpoint multipliers")
broke the default acceleration profile on Lenovo ThinkPad X200/201, where
the cursor speeds became so quick that it was practically impossible to
control. Merely dragging on the TrackPoint lightly would result in the
cursor flying from corner-to-corner.

I have tested on a Lenovo ThinkPad X201 to find
`AttrTrackpointMultiplier=0.25' the most reasonable and closest to the
default behaviour on Windows 7 with Lenovo's driver.

Not sure about ThinkPad X200s/201s, but I suspect that they would have
similar issues (with the multiplier set to 1.25). I have just ordered both
models to experiment with and will report back with another patch if I
find similar issue.

Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1080>
2024-11-14 22:02:54 +08:00
Mingcong Bai
97adececa0 quirks: add pressure pad quirk for Lenovo ThinkBook 14 G7+ ASP
Some Lenovo ThinkBook 14 G7+ ASP models ship with pressure pads (nominally
"Force Pad"). However, they do not appear to be declared as such by the
firmware.

Add a quirk to make them work.

Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1079>
2024-11-12 11:38:52 +08:00
Peter Hutterer
b2b0756e4e zsh: update completion to include latest debug-events options
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1077>
2024-11-06 06:38:44 +10:00
Peter Hutterer
6a88ffb5dd zsh: sort the debug-events argument (mostly) alphabetically
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1077>
2024-11-06 06:38:08 +10:00
Peter Hutterer
865b2e748f tablet: ignore movements started outside the configured area
If a tablet has an area configured and the pen goes into proximity
outside this area, ignore all events from this sequence. This truly
deactivates that area so it can even be used for e.g. placing a pen
there.

For simplicity, a sequence that starts outside the configured area will
be completely ignored, i.e. moving into the tablet area will not trigger
any fake proximity events as we cross into the allowed area. This
requires quite a bit of effort and it's unclear if it's really needed by
users - we can reconsider when we get complaints.

We do however accept a proximity event within within 3% of the
configured area.  This gives us 6mm on a 200mm tablet where we can move
in from the area and still have events work, i.e. some error margin for
where a user needs both an area and work closes to the edge of that
area.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013>
2024-11-05 12:10:48 +10:00
Peter Hutterer
0b28eeea5a tablet: implement support for area configuration for external tablets
For external tablets like the Intuos series we now expose the area
rectangle configuration and the (minimum) implementation required to
make this work.

Because an area configuration may apply late and tablet events usually
get scaled by the compositor we need to store the current axis extents
in each event. This is to behave correctly in this events sequence:

1. tool proximity in
2. caller changes config, config is pending
3. tool moves, generates events
4. tool goes out of prox, new config applies
5. caller processes motion events from step 3

If the caller in step five uses any of the get_x_transformed calls these
need to be scaled relative to the original area, not the one set in
step 2.

The current implementation merely clips into the area so moving a stylus
outside the area will be equivalent to moving it along the respective
edge of the area. It's not a true dead zone yet.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013>
2024-11-05 12:10:48 +10:00
Peter Hutterer
cf5b7bee01 Add tablet area configuration
This adds the configuration option to define a rectangle that serves as
an input area on external tablets such as an Intuos.

The intention behind this is to make this input area behave as if it was
the only physical input area on this tablet with libinput emulating
proximity events as required for where the tools moves in and out
of this area.

This could also be achieved with the existing calibration setting but
area configuration is not calibration and we don't want to expose other
side-effects of the matrix (e.g. scaling and rotation) for these
devices.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013>
2024-11-05 12:10:48 +10:00
Peter Hutterer
9735229dee tablet: use our absinfo_x/y struct instead of the libevdev one
device->abs.absinfo_x/y points to the x/y axis we want to use and
that axis is used in all the evdev helper function. For consistency
use that one here too.

This is for consistency only and has no effect on tablet devices, the
only time this isn't ABS_X/Y is on multitouch devices where that points to
ABS_MT_POSITION_X/Y.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013>
2024-11-05 12:05:05 +10:00
Peter Hutterer
cfbdca5953 Move evdev_convert_to_mm to a more generic helper
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013>
2024-11-05 12:05:05 +10:00
Peter Hutterer
df242c108d Move scale_axis to a utility header so we can re-use it better
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013>
2024-11-05 12:05:05 +10:00
Peter Hutterer
49bbef6468 tools/debug-events: print bugs in bold red
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013>
2024-11-05 12:05:05 +10:00
José Expósito
3f3071cb88 editorconfig: add settings for sym files
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1076>
2024-11-04 10:31:30 +00:00
Peter Hutterer
86915213c8 tools: sort the options in debug-events match page
We now have enough config options that having them unsorted makes it
hard to find the right option.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1075>
2024-11-04 15:48:49 +10:00
Peter Hutterer
d1e49c7b3d tablet: default to a built-in tablet
The vast majority of devices that libwacom doesn't know about are the
various built-in ones. Since the only effect in our code here is that we
enable the calibration matrix, let's default to built-in if we don't
know any better - better to have the matrix and not use it than to not
be able to calibrate a tablet.

Note that libwacom 2.11 and later also now default to a built-in tablet.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1074>
2024-10-31 15:58:31 +10:00
Peter Hutterer
2ac4227843 test: fix two race conditions waiting for proximity events
This test does a prox in/out and immediately drains events.
Where we are slow enough we may drain only one (or none) of the
proximity events which causes a failure later in the test.

Similar issue with the second test where we may get a delayed tip event.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1074>
2024-10-31 15:58:31 +10:00