Commit graph

5731 commits

Author SHA1 Message Date
Peter Hutterer
f27fbdfa53 meson.build: change set10 to set
Follow-up to cfec80582e ("meson.build: change from config.set10() and #if to config.set() and #ifdef")
which was parallel to 9e37bc0cfa and the latter didn't get updated.

Fixes: 9e37bc0cfa ("plugins: add support for lua plugins to change evdev event streams")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1347>
2025-10-31 05:25:29 +00:00
Jan Hendrik Farr
07659db3d9 quirks: add quirk for Google Chromebook Roric
Signed-off-by: Jan Hendrik Farr <kernel@jfarr.cc>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1353>
2025-10-30 13:40:59 +01:00
Peter Hutterer
f18bf988f7 lua: drop the log global in favor of libinput:log_*
The existence of the log global was in part due to early (pre-merge)
versions of the Lua plugins supporting multiple libinput plugin objects
per file. This is no longer the case and integrating the log functions
into the (single) libinput object makes the code more obvious (we're
calling libinput:log_debug() now, so it's obviously a libinput log
function) and we no longer mix dot with colon notations.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1350>
2025-10-30 13:12:50 +10:00
Peter Hutterer
6b9dbc2a25 lua: remove the inject_frame API
Injecting frame was the first implementation of adding event frames but
it has since effectively been replaced by append/prepend_frame which are
more predictable and easier to support.

In the Lua API injecting frames was only possible within the timer and
the only real use-case for this is to inject events that are then also
seen by other plugins. But that can be achieved by simply ordering the
plugin before the other plugins and using the append/prepend approach.

Until we have a real use-case for injecting events let's remove the API
so we don't lock ourselves into an API that may not do what it needs to
but needs to be supported for a long time.

Closes: #1210
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1351>
2025-10-30 02:08:13 +00:00
Peter Hutterer
2784973b4d doc/user: update the lua plugin documentation
Some clarifications, some fixes, some reshuffling, overall somewhat
better.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1349>
2025-10-30 01:46:33 +00:00
Peter Hutterer
22dda5b154 doc: some updates to the plugin system docs
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1349>
2025-10-30 01:46:33 +00:00
Peter Hutterer
07a9161ef2 tools: add support for NO_COLOR/FORCE_COLOR
Environment variables to control whether the output should not have
color or must have color, regardless of the tty-ness of the output
stream.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1348>
2025-10-27 12:35:44 +10:00
Peter Hutterer
141f571aae tools: don't set the tool pressure range if we're using the default
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1340>
2025-10-24 01:55:25 +00:00
Peter Hutterer
48a3391f33 tablet: don't consider a 0.0-1.0 pressure range as configured range
A caller is likely to unconditionally call
libinput_tablet_tool_config_pressure_range_set() with whatever
values it has in its config storage. Those values will be 0 and 1 by
default, we should not take this as a sign that the tool has a pressure
range.

Setting a pressure range resets the automatic offset handling which we
definitely don't want to do for the default range.

Fixes: #1177
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1340>
2025-10-24 01:55:25 +00:00
Peter Hutterer
bda0c7478e tablet: when configuring a user-defined pressure range, zero the offset
When a user configures a pressure range, the tool would get locked into
the current offset even if that offset was still pending. For example, a
sequence of

- tool in-prox with pressure 50%
- libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 0.9)
- tool out-of-prox, tool-in-prox
- libinput applies the tool config, tool now has a configured range,
  has_offset = true
- tool out-of-prox, tool-in-prox
- update_pressure_range() sees has_offset = true, scales the last offset
  (50%) to the actual offset.

Fix this by resetting the detected offset to zero when we shortcut the
heuristics. A user-defined pressure range should include the tool's
pressure offset anyway, the user knows this much better than our
heuristics.

Closes: 1177
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1340>
2025-10-24 01:55:25 +00:00
Peter Hutterer
66f2d121ee tablet: log the pressure offset's percentage once we detected it
Saying the offset is e.g. 15% is more informative to the user than a
vauge "we detected something".

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1340>
2025-10-24 01:55:25 +00:00
Peter Hutterer
60c5fdbc2f doc: fix wrong reference to the plugin system
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1345>
2025-10-24 01:34:52 +00:00
Yinon Burgansky
cc7dfccd22 filter: avoid division-by-zero when delta_time is zero in custom filter
delta_time can be zero when:
- the fallback acceleration function is used for multiple movement types
  (for example, pointer motion and wheel scrolling simultaneously)
- two different methods produce the same movement at the same time
  (for example, button-scrolling and wheel-scrolling)

Reusing the last delta_time is a graceful fallback even if there are
duplicate events or event-ordering bugs.

Signed-off-by: Yinon Burgansky <yinonburgansky@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1336>
2025-10-24 01:18:40 +00:00
Yinon Burgansky
94b7836456 filter: support accelerating high-resolution scroll wheel events
Dispatch high-resolution scroll wheel events through filter_dispatch_scroll
so they can be accelerated using the custom acceleration profile.

Low-resolution scroll wheel events are not accelerated to avoid zero
delta-time in the filter.

Signed-off-by: Yinon Burgansky <yinonburgansky@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1316>
2025-10-24 01:05:54 +00:00
Zephyr Lykos
2d4482e03d meson.build: remove useless meson version checks
meson version requirement is bumped to 0.64.0 since
9e37bc0cfa ("plugins: add support for lua plugins to change evdev event streams")

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1344>
2025-10-24 00:21:12 +00:00
Zephyr Lykos
607852e66d meson.build: mark executables with install_tag
install_tag is available since meson 0.60.0:
https://mesonbuild.com/Reference-manual_functions.html#executable_install_tag

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1344>
2025-10-24 00:21:12 +00:00
wangyafei
a60976c1d4 quirks: add quirks for Dell laptop with Sensel 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/1342>
2025-10-24 00:01:00 +00:00
José Expósito
aac0d3c2f8 quirks: Avoid accidental scroll for Logitech MX Master 2S
Similar to the MX Master 3, this mouse can send scroll events when the
wheel is pressed.

Add the "ModelScrollOnMiddleClick" quirk to avoid it.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1181
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1343>
2025-10-23 21:51:36 +00:00
José Expósito
327db95a7c doc/user: Document ModelScrollOnMiddleClick quirk
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1343>
2025-10-23 21:51:35 +00:00
José Expósito
4a705ba8d7 quirks: Rename QUIRK_MODEL_LOGITECH_MX_MASTER_3
The Logitech MX Master 2S also triggers accidental scroll events when
the mouse wheel is pressed [1].

Rename the "ModelLogitechMXMaster3" quirk to "ModelScrollOnMiddleClick"
to make it more generic.

[1] https://gitlab.freedesktop.org/libinput/libinput/-/issues/1181

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1343>
2025-10-23 21:51:35 +00:00
Peter Hutterer
d6e1f93812 plugins: update plugins for the current API
A few changes to the Lua API didn't get reflected in the example
plugins, let's update them.

Also included here is naming of all arguments, instead of _ use the
argument name even where unused. These are examples so being expressive
is more important than making any lua static checkers happy.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1339>
2025-10-23 13:28:16 +00:00
Peter Hutterer
dd3f931481 plugins: rename the flags to libinput_plugin_system_flags
"libinput_plugins_flags" is bound to be annoying to approximately
everyone who'll ever have to use them so let's rename this while we
still can. Renamed to libinput_plugin_system_flags to leave the
namespace open for a possible future libinput_plugin_flags that works
on individual plugins.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1337>
2025-10-23 13:13:01 +00:00
Peter Hutterer
d1720d351d meson.build: bump to 1.29.900
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1338>
2025-10-23 00:06:09 +00:00
Marge Yang
fcb5dfe515 quirks: add Dell laptop touchpad quirks
This touchpad is a pressure pad.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1335>
2025-10-21 17:25:13 +08:00
Peter Hutterer
43c7644f01 quirks: add a quirk for the RazerBlade142025 keyboard
Generated by tools/razer-quirks-lister.py

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1334>
2025-10-21 04:56:12 +00:00
Peter Hutterer
3307341ebf CI: drop the ci-fairy check-mr job
The only thing this checked was the checkbox for allowing maintainers to
edit the MR. Changed permissions checks now fail this job but luckily
the setting it checked has been the default for years anyway so we can
drop it.

https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/81

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1332>
2025-10-20 12:35:51 +10:00
Peter Hutterer
4b1bae3f8c tools/replay: rmdir, not unlink for directories
And if the directory happens to be nonempty, well, maybe anyother
libinput reply is running so let's ignore that.

Fixes: cdfe34f62a ("replay: use the runtime quirks for our replay quirks")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1330>
2025-10-20 02:01:23 +00:00
Peter Hutterer
f9977dba9c tools/replay: set the multiprocessing start method to fork
Python 3.14 has changed from fork to forkserver[1] which causes
libinput replay to fail with the following error when starting the
subprocesses:
   ValueError: ctypes objects containing pointers cannot be pickled

This is caused by the libevdev device being passed to the sub process.
A more proper fix may be to only initialize the device in the subprocess
and then signal the process to start replaying. But meanwhile, switching
back to fork will do.

[1] https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods

Closes #1204

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1330>
2025-10-20 02:01:23 +00:00
Marge Yang
3725bb0b93 quirks: add Dell laptop touchpad quirks
This touchpad is a pressure pad.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1329>
2025-10-16 06:13:34 +00:00
Cyrus Lien
d19f95ec21 quirks: add quirks for Dell Pro Rugged tablets for volume keys.
Close #1205

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1331>
2025-10-16 13:42:37 +08:00
Peter Hutterer
533d5f6ee1 lua: ignore unsupported event codes in modified frames
If a plugin adds events to an event frame that are not supported by the
target device we may eventually dereference a null pointer (for ABS_*
events) or, possibly, use an OOB index access (for buttons or keys).
Let's filter out any events that the device doesn't support immediately.

Fixes #1202

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1324>
2025-10-14 06:08:37 +00:00
Peter Hutterer
3250686e70 lua: add missing lua_pop for the evdev frame
Where a plugin returns a table to be processed we never popped that
table from the stack. Eventually this would lead to the plugin failing
as the stack size is exceeded.

Fixes #1195

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1323>
2025-10-14 05:53:06 +00:00
Sertonix
aa7d58005e Fix format strings on 32-bit with 64-bit time_t
This fixes a segfault when running the test suite on ppc musl

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1318>
2025-10-14 05:40:19 +00:00
José Expósito
5df3eb8527 quirks: add Dell 14 Premium touchpad quirks
This touchpad is a pressure pad.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1185
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1320>
2025-10-13 06:53:31 +00:00
José Expósito
185e1bd824 quirks: add Dell 16 Premium touchpad quirks
This touchpad is a pressure pad.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1198
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1320>
2025-10-13 06:53:31 +00:00
Daniel Brackenbury
195c39b21a quirks: revert Nulea USB quirk due to ID conflict
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1325>
2025-10-13 06:35:42 +00:00
Peter Hutterer
6dcb47185e triage-policies: add a bugbot hook for re-closing a bug
Having the bugbot comment on re-closing the same bug is friendlier than
just closing it, even if we explained it before already.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1321>
2025-10-13 06:21:26 +00:00
Daniel Brackenbury
e07e138809 quirks: add vendor quirks for Nulea M501 thumb trackball
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1322>
2025-10-09 18:39:49 -04:00
José Expósito
a4ea1e2d97 libinput: Add libinput_event_gesture forward declaration
Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1189
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1319>
2025-10-07 00:31:38 +00:00
Dan Forest
772c1f5ebb quirks: add quirk for Asus ROG Flow Z13 2025 (GZ302EA) keyboard
Keyboard must be detected as internal in order for "disable touchpad while typing" to work as expected.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1317>
2025-10-03 15:04:37 +00:00
Mingcong Bai
95281de7e4 quirks: lower AttrTrackpointMultiplier for Lenovo ThinkPad E16 Gen 3
Lower TrackPoint multiplier for Lenovo ThinkPad E16 Gen 3 to match closer
to Windows defaults. The default multiplier was way too quick.

Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1315>
2025-09-06 17:17:34 +08:00
José Expósito
32a9863507 quirks: Add quirks for the GPD MicroPC 2 touchpad
This laptop's touchpad has physical left, middle and right button, but
advertises itself as a clickpad.

Drop the incorrectly set INPUT_PROP_BUTTONPAD property.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1182

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1314>
2025-09-04 09:57:26 +02:00
José Expósito
a0a6ff2777 plugin/wheel: Use libinput_device_is_virtual()
Use this function instead of evdev_device_is_virtual().

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1313>
2025-09-02 10:59:31 +02:00
Peter Hutterer
60bcbb6c88 quirks: change VM devices to AttrIsVirtual
These devices had the debouncing disabled via a model quirk but
really they are virtual devices and should have all hw-specific
processing disabled - on the assumption that this will be handled
in the host. See also e.g. commit 5d23794d53 ("tablet: disable
smoothing for uinput devices").

Closes #1175

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1308>
2025-09-02 07:44:11 +00:00
David Santamaría Rogado
4f6c741570 quirks: HP OmniBook Ultra Flip Laptop 14-fh0xxx
HP OmniBook Ultra Flip Laptop 14-fh0xxx manages itself keyboard and
touchpad deactivation when HP's custom Intel ISH firmware is installed
in the system. Without the custom firmware tablet-mode switch isn't
exposed so there is no way we don't need this.
More detailed information in the file comment.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1311>
2025-09-02 07:23:22 +00:00
José Expósito
69ed729e80 quirks: don't disable the keyboard on the Dell Latitude 7285
Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1180
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1312>
2025-09-02 09:05:30 +02:00
Peter Hutterer
f3f8e8ef6c plugin: ensure prox out for a forced proximity tool if the tool changes
A device may send axis events while the tool is out of proximity,
causing our plugin to force a proximity in for the pen. If the tool then
sends a proximity event for a different tool we ended up with two tools
in proximity.

The sequence in #1171 shows this:

  - evdev:
    - [  1, 499608,   3,  27,       0] # EV_ABS / ABS_TILT_Y                0 (+30)
    - [  1, 499608,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +0ms
  - evdev:
    - [  2, 199637,   1, 321,       1] # EV_KEY / BTN_TOOL_RUBBER           1
    - [  2, 199637,   4,   4,      30] # EV_MSC / MSC_SCAN                 30 (obfuscated)
    - [  2, 199637,   1, 330,       1] # EV_KEY / BTN_TOUCH                 1
    - [  2, 199637,   3,   0,     910] # EV_ABS / ABS_X                   910 (+246)
    - [  2, 199637,   3,   1,    8736] # EV_ABS / ABS_Y                  8736 (-105)
    - [  2, 199637,   3,  27,     -25] # EV_ABS / ABS_TILT_Y              -25 (-25)
    - [  2, 199637,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +700ms

Fix this by remembering that we forced the tool out of proximity so if
we see tool events for another tool we force the pen out of proximity
again.

This will have some interplay with the other tablet plugins but
hopefully none that affect real-world devices, e.g. forcing a proximity
out means the proximity out timer plugin gets disabled. Since devices
behave in unexpected manners anyway let's see if it affects a real-world
device.

Closes #1171

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1306>
2025-08-31 00:18:59 +00:00
Peter Hutterer
ce1112c263 plugin: remove the proximity timer callback after prox out events
One of the code paths was addressed in b2cd9c69a0 but this path was
missing.

Fixes: b2cd9c69a0 ("plugin: remove the event frame callbacks when disabling a plugin")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1306>
2025-08-31 00:18:59 +00:00
Peter Hutterer
428a3299a8 plugin: don't initialize the debounce plugin on a virtual device
Effectively the same motivation as commit 5d23794d53 ("tablet: disable
smoothing for uinput devices") - virtual devices should not need
debouncing and if they do let's do the debouncing on the other end that
creates those devices.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1307>
2025-08-28 01:56:12 +00:00
Peter Hutterer
bdb51593fe quirks: add quirk for the RazerBlade162025 keyboard
Generated by tools/razer-quirks-lister.py

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1305>
2025-08-26 20:51:55 +00:00