Commit graph

5716 commits

Author SHA1 Message Date
Peter Hutterer
baf1ceca88 libinput 1.30.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2025-12-08 12:40:00 +10:00
Peter Hutterer
83d89dde5d test: rename a dwt test for better clarity
This is the "short-timeout after a single key press" dwt test so let's
rename it that way

(cherry picked from commit 2003ab3aef)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:43 +10:00
Peter Hutterer
58fe6f387f doc: fix a few miss-hyphenated disable-while-typing comments
(cherry picked from commit 4bb6a31894)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:42 +10:00
Peter Hutterer
b5b2d92ead touchpad: use INPUT_PROP_PRESSUREPAD as signal it's a pressurepad
Because, well, it says so on the box now. No more quirks, hopefully!

(cherry picked from commit db6a04665c)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:41 +10:00
Peter Hutterer
e3f4afccac include: sync headers with kernel 6.18
(cherry picked from commit 7621edab05)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:40 +10:00
Peter Hutterer
f2bf1d9aef test: silence a valgrind warning
(cherry picked from commit 39aea2a8d6)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:39 +10:00
Peter Hutterer
11063aa28b tablet: when destroying a tablet, unlink the tablet tools
If a caller holds a ref to a tablet tool when the device is
destroyed, the tool didn't get removed from the tablet->tool_list.

Later on tool unref the list_remove() would try to reset the pointers
but the list head was long since freed, causing an invalid write.

(cherry picked from commit 7e8298e9ec)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:38 +10:00
Peter Hutterer
5bf134e77b tablet: after three valid prox out events, unload the forced prox plugin
Once we receive three valid proximity out events for the pen, unload the
plugin that generates forced proximity in events for tablets that
don't send BTN_TOOL_PEN.

Closes #1222

(cherry picked from commit 49d9528bdf)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:37 +10:00
Peter Hutterer
b14894e794 tablet: only apply eraser button settings if we have a device
If the device is unplugged, our tool's last_device is NULL. If a caller
then tries to the toggle the eraser button setting libinput would crash.
Fix this by simply skipping the configuration until the tool goes back
into proximity over some other device (if any).

Closes #1223

(cherry picked from commit 1e8901d009)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:36 +10:00
Peter Hutterer
41d0caf333 tablet: return the wanted eraser button mode/button from the config
This matches our behavior for other settings - always return the
user-configured setting from the configuration API, not the current
setting (which may be delayed until the device is in a netural state).

(cherry picked from commit a6ad084280)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1375>
2025-12-08 10:27:30 +10:00
Peter Hutterer
11b97edcdc libinput 1.30.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2025-11-25 13:40:43 +10:00
Peter Hutterer
c2f9ffe17e doc/user: drop references to the touchpad-edge-detector
We've had libinput measure touchpad-size for 5 years now, let's refer
only to that.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1368>
2025-11-24 14:29:56 +10:00
Peter Hutterer
21e3a76bf5 libinput 1.29.902 2025-11-18 12:29:32 +10:00
Peter Hutterer
9461d1a9a1 Revert "lua: drop compatibility to 5.1 to allow for luajit"
While luajit seems to be the most popular (and fastest) lua
implementation for higher-level implementations, at the system level
it is relatively unused. Lua 5.4 on the other hand is used by other
system-level components like wireplumber and RPM. In the latter case
this means that lua is already available on every rpm-based distro
without further dependencies.

The performance of 5.4 seems to be acceptable and while luajit may be
faster the extra dependency requires more maintenance. Let's only expose
ourselves to that if absolutely needed.

This is not a strict revert because the code has changed a bit since
with several bugfixes deployed on top.

This reverts commit 2723cadaeb.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1366>
2025-11-18 01:46:53 +00:00
Peter Hutterer
a595f0bd48 lua: export _VERSION so plugins can check the lua version
Since we only support one version this is not very informative but let's
include this now in case we ever need it in the future.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1365>
2025-11-17 16:48:35 +10:00
David Senoner
32ed3060f9 meson.build: use absolute path for callouts in udev rules
Udev rules can be put in many different directories to be found by udev
(see link #1). The callouts can be put only in one specific directory
if you want them to be found by using a relative path (only in
UDEV_LIBEXECDIR, see link #2). By passing the absolute path to the rule
you can make sure the callout will always be found.

Link 1: https://man7.org/linux/man-pages/man7/udev.7.html
Link 2: https://github.com/systemd/systemd/blob/main/src/udev/udev-spawn.c#L289

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1364>
2025-11-12 07:49:18 +01:00
Yinon Burgansky
a12dc6eba3 filter: differentiate scroll wheel from button scrolling to fix wheel speed
Commit 94b7836456 ("filter: support accelerating high-resolution
scroll wheel events") introduced a regression where high-res scroll
wheel events were incorrectly normalized by DPI. Mice with non-default
DPI (e.g., Logitech G502 at 2400 DPI) had their scroll wheel speed
reduced by the DPI ratio (1000/2400), resulting in 2-3x slower
scrolling.

The "noop" filter functions were actually performing DPI normalization
or applying a constant acceleration factor, which is appropriate for
button scrolling but incorrect for scroll wheels that have their own
units.

Add a filter_scroll_type enum (CONTINOUS, WHEEL, FINGER to match the
public events) passed through the filter_scroll interface. Update all
filter implementations to skip acceleration and normalization for wheel
events while maintaining existing behavior for button scrolling and
touchpad scrolling.

The custom acceleration profile continues to accelerate high-res wheel
events as designed.

Fixes: 94b7836456 ("filter: support accelerating high-resolution scroll wheel events")

Closes: #1212

Signed-off-by: Yinon Burgansky <yinonburgansky@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1363>
2025-11-11 14:43:41 +10:00
Marien Zwart
f6caae2289 quirks: add quirk for MX Master 4
The scrollwheels are similar to the MX Master 3, and need the same
quirks: the horizontal wheel events are inverted (it scrolls "naturally"
by default while the horizontal scrollwheel direction is "traditional"),
and middle-clicking without scrolling is very difficult with high-res
scroll events (from the hid_logitech_hidpp kernel module) enabled.

This adds the device ID seen through Bluetooth, which seems to be the
only one we can add a quirk for:

- When connected using the Bolt receiver, there is no separate device ID
  for the mouse (just the same 046d:c548 ID for the receiver already
  documented as supporting multiple mice).

- When connected through USB, the mouse charges but does not provide HID
  events through USB (it can be used while charging but only by using a
  separate Bluetooth or Bolt connection for HID).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1362>
2025-11-09 00:09:47 +00:00
Jan Hendrik Farr
20a3131947 quirks: add quirk for Google Chromebook Rull
Signed-off-by: Jan Hendrik Farr <kernel@jfarr.cc>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1360>
2025-11-08 23:53:49 +00:00
Marien Zwart
822e571272 doc: fix gitlab remote url
SSH to gitlab.freedesktop.org times out.
ssh.gitlab.freedesktop.org (copied from the Gitlab UI) works..

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1361>
2025-11-08 15:02:59 +11:00
Peter Hutterer
9c78f989fb CI: bump to Fedora 43 and Ubuntu 25.10
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1355>
2025-11-07 15:13:08 +00:00
Peter Hutterer
9b37ffd340 meson.build: fix indentation for the python files
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1357>
2025-11-06 23:46:42 +00:00
Peter Hutterer
b9a04e4d57 meson.build: export the plugin dir via pkgconfig
This is for the system-wide plugindir only - the only path where we'd
expect other packages to put plugins.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1357>
2025-11-06 23:46:42 +00:00
Peter Hutterer
4fd5fe9d30 Fix clang-tidy false positives
Array out of bounds complaints but it's a false positive where
clang-tidy makes up some event flow that cannot happen.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1358>
2025-11-06 23:31:27 +00:00
Peter Hutterer
941aa9f997 plugins: add an example for using a wheel to trigger button scrolling
See https://gitlab.freedesktop.org/libinput/libinput/-/issues/1206

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1356>
2025-11-06 23:18:43 +00:00
Peter Hutterer
b870abd2f3 libinput 1.29.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2025-11-04 11:58:29 +10:00
Peter Hutterer
ad6f580b6d lua: add select to the list of allowed functions
This function is safe (and was already documented) so let's make sure
it's available.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:15 +00:00
Peter Hutterer
4ffd8ab544 lua: fix the event type/code loops - EV_MAX/ABS_MAX is inclusive
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:15 +00:00
Peter Hutterer
eac44529d8 lua: return an empty table as device info after device removal
As the documentation already promises.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:14 +00:00
Peter Hutterer
4fe3225050 lua: remove the unpack global function
Looks like 5.1 and later has unpack as table.unpack().

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:14 +00:00
Peter Hutterer
45878c3aac lua: fix superfluous comma
Not sure how this compiled but whoah, definitely not supposed to be
there.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:14 +00:00
Peter Hutterer
f0d8002255 plugins: fix some minor issues with the example plugins
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:13 +00:00
Peter Hutterer
037c07d76f doc/user: fix a few issues with the Lua API documentation
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:13 +00:00
Peter Hutterer
1dcf630584 plugins: add an example plugin on how to reconfigure the Copilot key
As Microsoft has decreed, that key sends LEFTMETA + LEFTSHIFT + F23
(usually across multiple frames) and the then the same in reverse when
released.

xkeyboard-config 2.44 maps this sequence by default to XF86Assistant but
for the use-cases where this does not work reshuffling the whole event
sequence is the best approach and that can easily be done with a plugin.

Note that this is the minimum effort plugin - it works for one
keyboard at at time (duplicate the plugin if two keyboards are needed,
or remove the vid/pid check) and it does *not* intercept the meta/shift
key presses and delay them, it simply releases them on F23 and then
replays the new sequence. Good enough for an example plugin.

Example sequence produces shift + a on press and releases a + shift on
release. Holding the key will thus produce AAAAAAAAA which is an
excellent summary of how this key was designed.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1352>
2025-11-03 03:57:00 +00:00
Peter Hutterer
eb01a4e73f plugins: add meson option to autoload plugins
Add an option to enable autoloading plugins from the default paths.
This makes testing and adoption for new users easier as they can (if
necessary) rebuild libinput with that option enabled instead of having
to wait for the compositor stack to update.

Autoloading will only use the default paths (/etc and /usr/lib) and will
only happen if the client does not modify those paths since that implies
the client wants to load plugins themselves. A client that adds a plugin
path but doesn't load the plugins is considered buggy anyway.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1347>
2025-10-31 05:25:29 +00:00
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