Commit graph

4963 commits

Author SHA1 Message Date
Peter Hutterer
bb1b1304df test: fix two wrong timeout calls
This are tests with drag lock enabled, so our timeout needs to be
be the tap and drag timeout (which is higher than the normal tap timeout).
Only worked because they're similar enough that if there's a bit of a
delay, the extra ms push us over the line.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
09b59e42fb test: fix some tests that may cause pointer jumps
Increase the number of events to move from one position to the next to
avoid accidental pointer jumps.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
34f86489a8 Revert "test: allow for substring matching in the various --filter- arguments"
Substring matching means it's impossible to select filters that are
substrings of others, making it too painful to test one specific filter.

This reverts commit a524cf9761.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
c775c23121 test: slightly increase the finger switch timeout wait
In touchpad_2fg_scroll_return_to_motion we sometimes fail because the
timeout is too close to the actual timeout expiry, creating a race
condition on whether the scroll stop event (triggered by the gesture
end) is sent before or after the timeout expiry.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
30c6d5983d test: add two more more libinput_dispatch() calls
We're writing a lot of events here, if the system isn't fast enough or
(in the future) if we have a custom socket instead of a kernel device we
might fill up the write buffer, causing the test to fail.

Easy workaround is to dispatch more often to ensure the data is being
read from the fd.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
d6e54c3597 util: fix error in mkdir_p if a parent directory fails to be created
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
9c69152428 Move mkdir_p into a utility header
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
3644372696 test: add helpers for checking (negative) errnos
This way we get to see the actual error when it happens.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
4935e52652 util: add a LIST_INIT macro
Necessary for the case where we need a compile-time initialized list.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
2024-03-18 16:25:47 +00:00
Peter Hutterer
3a935507ae ci: bump to Fedora 39 and FreeBSD to 13.2
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/985>
2024-03-18 12:31:59 +10:00
Peter Hutterer
301895685e tools: fix two black warnings
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/985>
2024-03-18 12:29:57 +10:00
Peter Hutterer
bf061ad157 quirks: Add a the onebutton apple touchpad quirk for an old MacBook
This is a 2006 Macbook, model A1181. Should fix the warning:
  event9  - appletouch: kernel bug: missing right button, assuming it is a clickpad.

Related #981

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/983>
2024-03-13 11:52:00 +00:00
Peter Hutterer
15609213a6 touchpad: disable the immediate scroll state if tapping is enabled
On a touchpad without gestures we would take a 2-finger touch as
immediate start to a 2-finger scroll gesture. This effectively removes
the 1mm threshold we otherwise have before scrolling is assumed to have
started.

If tapping is enabled and a user triggers a small motion event this
results in scroll events being sent before the two-finger tap.

Closes #981

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/982>
2024-03-12 15:19:59 +10:00
Derrick Timmermans
6faab3a1d4 Add quirk for the Legion Slim 7 Gen 8 keyboard
Signed-off-by: Derrick Timmermans <derrick.timmermans@outlook.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/980>
2024-03-06 10:14:35 +01:00
José Expósito
bee06c10ce quirks: add quirk for Dell Precision 5480 touchpad
The Dell Precision 5480 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 being too small. Disable
the quirk for this specific model.

Closes: #976
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/979>
2024-02-29 09:51:43 +01:00
José Expósito
a43f1edbfe Add libinput_device_get_id_bustype()
Allow to get the device bus type ID in addition to its vid and pid.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/975
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/977>
2024-02-28 22:49:29 +00:00
José Expósito
7ac26ed9c2 CONTRIBUTING: Add CONTRIBUTING.md
Add a very basic CONTRIBUTING.md file with a link to the documentation.

Closes: #974
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/978>
2024-02-28 17:07:45 +01:00
José Expósito
b5b825a7c3 doc/user: Document "Closes" and "Fixes" tags
Describe how the tags should be used. The guidelines for the "Fixes"
tag are taken from the Linux kernel documentation [1][2].

[1] https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes
[2] https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html#describe-changes

Closes: #974
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/978>
2024-02-28 16:59:58 +01:00
Peter Hutterer
399ba5e0ee CI: only check the MR if we're in a merge request pipeline 2024-02-28 18:53:25 +10:00
Joshua Goins
beca998122 tablet: add API for relative dials
Some tablets such as those in the XP-PEN PRO series use "dials" which
are actually scrollwheels and emit EV_REL events. These should not be
emulated as rings (which are absolute) so we must expose them as a new
tablet event.

Adds LIBINPUT_EVENT_TABLET_PAD_DIAL that work largely identical as our
high-resolution wheel events (i.e. the values are in multiples or
fractions of of 120). Currently supports two dials.

This is a lot of copy/paste from the ring axes because the interface is
virtually identical. The main difference is that dials give us a v120
value in the same manner as our scroll axes.

Notes:
- REL_DIAL is mutually exclusive with REL_WHEEL, we assume the kernel
  doesn't (at this point) give us devices with both. If this changes for
  devices with three dials (wheel + hwheel + dial) we need to add code
  for that.
- REL_DIAL does not have a high-resolution axis and we assume that any
  device with REL_WHEEL_HI_RES will also have REL_HWHEEL_HI_RES (if the
  second wheel exists).
- With dials being REL_DIAL or REL_WHEEL there is no possibility of
  detecting a finger release (the kernel does not route EV_RELs with a
  value of zero). Unless this is implemented via a side-channel - and it
  doesn't look like any hardware that supports dials does that - we
  cannot forward any information here. So unlike absolute rings we
  cannot provide a source information here.

Closes #600

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/967>
2024-02-20 02:49:05 +00:00
Peter Hutterer
d487ca36a4 test: only expect one button event from the intuos-like test
BTN_0 is the only one guaranteed to exist (otherwise we skip the test)
so let's ensure we have at least one event - all the others will fail if
we don't get the right event sent.

This enables the test to run against devices that only have one button.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/967>
2024-02-20 02:49:05 +00:00
Josip Medved
566857bd98 Recognizing Framework 16 keyboard modules as internal keyboards 2024-02-19 03:20:32 +00:00
Peter Hutterer
0d7b281f49 doc: fix end-of-file in the state machine SVG
Picked up by the pre-commit hook
2024-02-19 12:21:16 +10:00
Peter Hutterer
18d1d4fd75 quirks: tighten the match for the Graviton N15i touchpad
Other systems use the same touchpad but without physical buttons (e.g.
SpeedMind M-BOOK) and obviously the various systems using the 5288
touchpad, see commit d1f274c7.

Let's tighten this quirk to just the Graviton only.

Closes #970
Fixes 8163b552be23ef3f4082775649bb12a3f6162df6
Related !957
2024-02-14 06:23:59 +00:00
Bogdan Mircea
83d780e572 Added quirks for TongFang/Uniwill touchpad and ITE keyboard 2024-02-12 11:04:59 +00:00
Peter Hutterer
f46d45a589 doc: drop permissions to 644 for the gesture state machine SVG
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-02-06 11:32:42 +10:00
Theluga
8b9328415e quirks: Add Lenovo's Ideapad Gaming 3 white backlit keyboard as an internal keyboard 2024-02-02 01:43:10 +00:00
Peter Hutterer
8079a51b7f doc/user: note the requirement to apply for gitlab fork permissions 2024-02-02 09:51:31 +10:00
Peter Hutterer
049beea4c5 triage-policies: add a bugbot command to close issue in favour of an MR 2024-02-02 09:51:31 +10:00
Hooloovoo Blue
1788d3523f Update 50-system-lenovo.quirks to fix X201t tablet buttons 2024-02-01 04:25:09 +00:00
Peter Hutterer
4bc27543e9 tablet: add tablet tool pressure range configuration
Add a configuration option to reduce the available hardware range to a
fraction thereof. This is done by copying the absinfo struct for the
pressure value and adjusting that copy's minimum/maximum value for
scaling into the target normalized range.

The 1%/5% tip thresholds are kept but pressure offset detection is
disabled if there is a custom pressure range.

Unlike the pressure curve which is implemented in the compositor, the
pressure min/max range needs to be in libinput, primarily because the
tip threshold needs to adjust to any new minimum, allowing for
light touches with a pen without triggering tip down even at a higher
hardware pressure.
2024-01-30 14:29:25 +10:00
Peter Hutterer
47f0bce7ec tablet: document a known bug about pressure thresholds across tablets 2024-01-30 14:29:25 +10:00
Peter Hutterer
54aa01a267 tablet: move tool creation into a helper function 2024-01-30 14:29:25 +10:00
Peter Hutterer
7cffd28e8f tablet: don't use absinfo_range for the percentage calculation
Our percents are inclusive 0% and 100%.
2024-01-30 14:29:25 +10:00
Peter Hutterer
0322403ea4 tablet: fix tilt handling for even-ranged tablets
The tablet tilt range may be set as [-N, M] in which case we assume that
a value of zero is vertical (and thus should result in a libinput tilt
value of zero). Unfortunately some tablets report an even total value
range, e.g. [-64, 63] so zero is not actually the mathematical center of
the axis.

Fix this by bumping the axis maximum so zero becomes the logical center.
All devices we've seen so far have [-A, (A-1)] as range so bumping it by
one makes it symmetric.
2024-01-30 14:29:25 +10:00
Peter Hutterer
72eca2db56 util: add a helper to normalize an axis to [0.0, 1.0]
Like the input axis, a normalized range has min/max inclusive so we
cannot use the absinfo_range() helper which assumes the max is exclusive.

Reverts parts of 4effe6b1b9
2024-01-30 14:29:25 +10:00
Peter Hutterer
f20eefbc59 Revert "tablet: fix the pressure offset range being off by one"
Fixing the range is only required when the output range is not inclusive
of the min/max (such as when mapping an abs axis to a screen width).

Our pressure range is inclusive 0.0 and 1.0, so we want absinfo->maximum
to map to exactly 1.0

This reverts commit a5b6f4009b.
2024-01-30 14:29:25 +10:00
Peter Hutterer
8bb53150a9 tablet: handle BTN_STYLUS3
And add a test to make sure the tool we know that has three buttons (Pro
Pen 3) can send all those. Enough to run that test one one compatible
device, no real benefit of running it on all tablet devices.
2024-01-24 12:34:25 +10:00
Peter Hutterer
2218da2f31 test: fix a wrong value for the auto-assigned BTN_TOOL
This was actually passed through:
  litest debug event19 - 0.000 EV_KEY           BTN_TOOL_PEN         -2147483648
2024-01-22 01:21:29 +00:00
Peter Hutterer
8603584e33 test: set pressure to zero on proxout for the tablets with forced prox out
If a test goes past the tip-down threshold, the proximity timeout does
not trigger. And one can spend a long time trying to debug why the test
fails...

As far as I vaguely remember, these devices' pressure values are correct
enough, it's just the lack of BTN_TOOL_PEN that is the issue so instead
of a proper proximity out, we just send enough data to set the pressure
to below the tip threshold.
2024-01-22 01:21:29 +00:00
Peter Hutterer
c5f808ac2e test: debug print the events we're draining 2024-01-22 01:21:29 +00:00
Peter Hutterer
cf1c07e066 Add a helper for radians to degrees 2024-01-16 19:49:02 +10:00
José Expósito
3fd38d8927 libinput 1.25.0
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2024-01-15 09:53:20 +01:00
Peter Hutterer
11a7de7640 evdev: default tablets to allow for rotation
If libwacom is disabled or there is no .tablet file in libwacom for this
device yet, default to enabling a left-handed setting. Otherwise the
tablet may not be usable.

See https://github.com/linuxwacom/libwacom/issues/616
2024-01-03 12:20:16 +10:00
Peter Hutterer
d5ff9d75a8 triage-policies: emphasize that recordings must be attached 2024-01-03 08:40:17 +10:00
Aiden
5abe45cd49 Add Lenovo ThinkPad E14 Quirk 2023-12-24 13:50:33 -05:00
Peter Hutterer
19446a029b fallback: add messages for touch arbitration debugging 2023-12-19 04:26:50 +00:00
Peter Hutterer
c22ee58b4c triage-policies: add bugbot labels for requesting hid-recorder output
And libinput record too while we're at it.
2023-12-19 10:15:04 +10:00
Airat Makhmutov
106b61e216 quirks: touchpad quirk for Graviton N15i-K2
The generic quirk introduced in commit d1f274c7 ("quirks: add a
more generic match for the 5288 Synaptics clickpad") affects the
touchpad (with physical buttons) present in the Graviton N15i-K2.
2023-11-29 12:17:47 +00:00
Peter Hutterer
b600cc35c5 gitlab: make the bug template the default template
This way users who don't know gitlab much but are most likely reporting
a bug get to use this template and anyone else can remove the
boilerplate and be more free-form and/or prosaic.
2023-11-23 09:53:09 +10:00