Commit graph

5645 commits

Author SHA1 Message Date
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
Alexander Bruy
d9c9e0ff25 add quirk for TongFang GX4 (X4SP4NAL) touchpad
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1302>
2025-08-20 08:07:36 +00:00
Peter Hutterer
4d317eae17 plugin: reset the filtered frame after sending it with buttons
Our filtered frame (frame without any button events) that gets passed
down to here may include relative motion or other events. Once we use
that frame to prepend the button event we need to reset it so we don't
cause duplicate motion and/or events with zero delta timestamps.

With the the previous code we got two identical frames:

  42: event25: plugin button-debounce        - 0.360 EV_MSC           MSC_SCAN               30
  ... event25: plugin button-debounce        - 0.360 EV_KEY           BTN_RIGHT               1
  ... event25: plugin button-debounce        - 0.360 EV_REL           REL_X                  -7
  ... event25: plugin button-debounce        - 0.360 EV_REL           REL_Y                  -7
  ... event25: plugin button-debounce        - 0.360 ----------------- EV_SYN ----------------- +8ms
  ... Plugin:button-debounce - debounce state: DEBOUNCE_STATE_IS_UP → DEBOUNCE_EVENT_OTHERBUTTON → DEBOUNCE_STATE_IS_UP
  ... Plugin:button-debounce - debounce state: DEBOUNCE_STATE_IS_UP → DEBOUNCE_EVENT_PRESS → DEBOUNCE_STATE_IS_DOWN_WAITING
  ... event25: plugin evdev                  - 0.360 EV_MSC           MSC_SCAN               30
  ... event25: plugin evdev                  - 0.360 EV_REL           REL_X                  -7
  ... event25: plugin evdev                  - 0.360 EV_REL           REL_Y                  -7
  ... event25: plugin evdev                  - 0.360 EV_KEY           BTN_RIGHT               1
  ... event25: plugin evdev                  - 0.360 ----------------- EV_SYN ----------------- +0ms
  ... Queuing  event25  POINTER_MOTION               +0.000s	-7.00/ -7.00 ( -7.00/ -7.00)
  ... event25 - middlebutton state: MIDDLEBUTTON_IDLE → MIDDLEBUTTON_EVENT_R_DOWN → MIDDLEBUTTON_RIGHT_DOWN, rc 1
  ... event25: plugin evdev                  - 0.360 EV_MSC           MSC_SCAN               30
  ... event25: plugin evdev                  - 0.360 EV_REL           REL_X                  -7
  ... event25: plugin evdev                  - 0.360 EV_REL           REL_Y                  -7
  ... event25: plugin evdev                  - 0.360 EV_KEY           BTN_RIGHT               1
  ... event25: plugin evdev                  - 0.360 ----------------- EV_SYN ----------------- +0ms
  ... Queuing  event25  POINTER_MOTION               +0.000s	 -nan/  -nan ( -7.00/ -7.00)
 event25  POINTER_MOTION               +0.360s	-7.00/ -7.00 ( -7.00/ -7.00)
 event25  POINTER_MOTION            2  +0.360s	 -nan/  -nan ( -7.00/ -7.00)

The 0ms delta caused a -nan in the custom pointer accel but even without
that bug the pointer would've jumped more than it should.

Closes #1172

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1301>
2025-08-20 07:49:01 +00:00
Peter Hutterer
2f2bd357bc plugin: don't register the mouse-wheel plugin for passthrough devices
If a device is immediately set to PASSTHROUGH let's skip registering
this plugin for this device. We're not doing anything with the events
anyway.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1300>
2025-08-19 15:22:49 +10:00
Peter Hutterer
b2cd9c69a0 plugin: remove the event frame callbacks when disabling a plugin
In all cases we remove the device's handling from the plugin so let's
remove the event frame callback for this device.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1300>
2025-08-19 15:22:49 +10:00
Peter Hutterer
3ff1a2e24d plugin: when disabling wheel-debouncing set to the correct enum value
This isn't a boolean. Let's change the first enum value to something
truthy so any use as boolean is more likely to trigger test failures.

Fixes: 18992b2ec0 ("plugin: allow disabling the wheel debouncing feature")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1300>
2025-08-19 15:22:49 +10:00
Peter Hutterer
e45cd2bc13 util: print nonchanged axis with a space instead of a *
When printing tablet events always print a '*' or ' ' suffix to ensure
the alignment of the next field matches. We're using a tab to align
after each field so if the string length doesn't match, our events may
print at different tab stops.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1299>
2025-08-18 23:11:03 +00:00
Peter Hutterer
537552480d plugin: expand the plugin name prefix to 22 chars
That's the longest name we have for our internal plugins so let's make
sure those align nicely for easier debugging.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1299>
2025-08-18 23:11:03 +00:00
Peter Hutterer
5abe051a9c doc/user: fixes and a TOC for the Configuration Options page
A typo fix, more links and a local TOC since we now have quite a few
options.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1296>
2025-08-12 15:20:12 +00:00
Peter Hutterer
9b58177a7e doc/user: add eraser buttons to the "Configuration Options" page
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1296>
2025-08-12 15:20:12 +00:00
Peter Hutterer
cdfe34f62a replay: use the runtime quirks for our replay quirks
Closes #1166

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1297>
2025-08-12 07:58:07 +00:00
Peter Hutterer
ce87da63ba quirks: add XDG_RUNTIME_DIR/libinput to the quirks directories
This allows tools like libinput-replay and the test suite to install
temporary quirks without having to mess with actual system-installed
files or directories.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1297>
2025-08-12 07:58:07 +00:00
Peter Hutterer
4e002383cf clang-tidy: fix WarningAsErrors option to actually work
Not a boolean, despite what one would immediately assume.

Closes #1168

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1298>
2025-08-11 15:27:35 +10:00
Peter Hutterer
17617a75c4 pad: add some extra asserts to shut up clang-tidy
For some reason clang-tidy believes that in the second iteration group
is set to NULL and causes a NULL-pointer dereference.

../src/evdev-tablet-pad.c:305:2: error: Access to field 'next' results in a dereference of a null pointer [clang-analyzer-core.NullDereference,-warnings-as-errors]
  305 |         list_for_each(group, &pad->modes.mode_group_list, link) {
      |         ^
../src/util-list.h:265:13: note: expanded from macro 'list_for_each'
  265 |              pos = list_first_entry_by_type(&pos->member, __typeof__(*pos), member))
      |                    ^
../src/util-list.h:202:2: note: expanded from macro 'list_first_entry_by_type'
  202 |         container_of((head)->next, container_type, member)
      |         ^

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1298>
2025-08-11 15:27:31 +10:00
Peter Hutterer
48a26f91c3 CI: change the wayland-web job to use rules
"only: ..." is deprecated and we should be using rules

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1294>
2025-08-08 09:18:22 +00:00
Peter Hutterer
c0519c3b5e Correct the @since tags for the new plugin functions
Fixes: d557a649fd ("Add a public plugin system to libinput")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1295>
2025-08-08 05:06:04 +00:00
Nat Karmios
960df4d8b8 quirks: Ignore BTN_0 for Microsoft Surface Keyboard
Signed-off-by: Nat Karmios <nat@karmios.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1293>
2025-08-08 00:39:06 +01:00
Peter Hutterer
347ff90871 lua: implement support for disabling of features
Because our lua hooks don't expose the device-added callback we need to
cache any calls to disable a feature and then apply it quietly when the
device is actually added. Any other call can go straight through.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
2025-08-07 10:23:30 +10:00
Peter Hutterer
5b2a723a02 touchpad: allow disabling palm detection altogether
Also a long-requested configuration option but it's difficult to expose
- depending on the touchpad we utilize different palm detection methods
and in theory may add to those at any time as we see fit.

Disabling it completely via a configuration option is only going to get
us more bug reports because *some* palm detection is likely desired on
most setups. So let's allow disabling it in a plugin and thus leave any
further palm detection code up to the plugin.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
2025-08-07 10:23:30 +10:00
Peter Hutterer
afd3be9a99 touchpad: allow disabling the touchpad hysteresis
Over the years we had a few devices that required some special
hysteresis handling - all of it very customized to the device and not
upstreamable (or even implementable by upstream without the device).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
2025-08-07 10:23:30 +10:00
Peter Hutterer
2bb9c66cd7 touchpad: allow disabling the touchpad jumping cursor detection
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
2025-08-07 10:23:30 +10:00
Peter Hutterer
18992b2ec0 plugin: allow disabling the wheel debouncing feature
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
2025-08-07 10:23:30 +10:00
Peter Hutterer
cf52552eef plugin: allow disabling the button debouncing feature
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
2025-08-07 10:21:59 +10:00
Peter Hutterer
7ac051ab41 plugin: add hooks to disable internal features
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1249>
2025-08-07 10:21:36 +10:00
Peter Hutterer
4f0b82800a plugins: remove two unused cleanup functions
Let's make clang tidy happy so at least one of us is.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1292>
2025-08-06 07:34:55 +00:00
Peter Hutterer
aa9d5bf630 util: silence two clang-tidy false positives
Both about the same complaint, somehow it is of the impression that
masks->mask can be an uninitialized value. The only place where we
allocate those is in _infmask_ensure_size() and they're set to zero
there.

libinput/src/util-bits.h:166:22: warning: The left operand of '&' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
  166 |         return !!(mask.mask & bit(bit));
      |                             ^
libinput/src/util-bits.h:444:2: note: Calling 'infmask_set_bit'
  444 |         infmask_set_bit(&m, mask);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
libinput/src/util-bits.h:394:15: note: Calling 'infmask_bit_is_set'
  394 |         bool isset = infmask_bit_is_set(mask, bit);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libinput/src/util-bits.h:382:13: note: Field 'mask' is non-null
  382 |         if (!mask->mask || bit / bitmask_size() >= mask->nmasks)
      |                    ^
libinput/src/util-bits.h:382:6: note: Left side of '||' is false
  382 |         if (!mask->mask || bit / bitmask_size() >= mask->nmasks)
      |             ^
libinput/src/util-bits.h:382:2: note: Taking false branch
  382 |         if (!mask->mask || bit / bitmask_size() >= mask->nmasks)
      |         ^
libinput/src/util-bits.h:385:9: note: Uninitialized value stored to 'mask.mask'
  385 |         return bitmask_bit_is_set(mask->mask[bit / bitmask_size()], // NOLINT(core.UndefinedBinaryOperatorResult)
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  386 |                                   bit % bitmask_size());
      |                                   ~~~~~~~~~~~~~~~~~~~~~
libinput/src/util-bits.h:385:9: note: Calling 'bitmask_bit_is_set'
  385 |         return bitmask_bit_is_set(mask->mask[bit / bitmask_size()], // NOLINT(core.UndefinedBinaryOperatorResult)
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  386 |                                   bit % bitmask_size());
      |                                   ~~~~~~~~~~~~~~~~~~~~~
libinput/src/util-bits.h:166:22: note: The left operand of '&' is a garbage value
  166 |         return !!(mask.mask & bit(bit));
      |                   ~~~~~~~~~ ^

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1292>
2025-08-06 07:34:55 +00:00
Peter Hutterer
b831068fbb util: annotate that our mask cannot be NULL
Poor clang-tidy thinks that there's a code-path here that lets us
return with a NULL mask.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1292>
2025-08-06 07:34:55 +00:00
Peter Hutterer
a0d286741c touchpad: fix a clang-tidy warning
../src/evdev-mt-touchpad-buttons.c:1233:16: warning: Value stored to 'button' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
 1233 |         evdev_usage_t button = evdev_usage_from_uint32_t(0);
      |                       ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1292>
2025-08-06 07:34:54 +00:00
Peter Hutterer
5495511485 tools: move a clang-tidy silence back to where it needs to be
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1292>
2025-08-06 07:34:54 +00:00
Peter Hutterer
4ef50ee946 test: fix two clang-tidy dead store complaints
udev_device isn't used but we assign it for being auto-freed.

And color is overwritten immediately but it's better to have a known
good value for it anyway.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1292>
2025-08-06 07:34:54 +00:00
Peter Hutterer
a102269364 util: mark the various bitmask functions as nonnull
Might as well get a bit of compiler help here.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1292>
2025-08-06 07:34:54 +00:00
Peter Hutterer
2562c24f95 pad: don't assert when unable to find the mode group, just discard
Instead of a hard assert if we fail to find the mode group for the given
ring/dial/strip let's just log an error and discard the event.

I'm not sure this assert can be triggered in the current code base but
if it can an error message is going to be more useful to the user than
an assert.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1291>
2025-08-04 12:53:10 +10:00
Adam Sampson
47d4c563f4 evdev: remove duplicate sizeof
This looks like a copy-and-paste error. In practice it was harmless on
64-bit systems because evdev_event happens to be 64 bits long, but on
32-bit systems it would allocate too little memory.

Found by GCC 15 with _FORTIFY_SOURCE=3 on ia32.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1288>
2025-08-01 22:34:07 +00:00
Adam Sampson
931dad76a9 test: correct value type in atou64_test
This needs to be an unsigned 64-bit value, given the constants that are
stored in this field below; unsigned long is 32 bits on some platforms
(e.g. ia32).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1288>
2025-08-01 22:34:07 +00:00
Matt Turner
7f3aa8058a test: Accept mkdir_p("/proc/foo") might return EACCES
... as it does under Gentoo's sandbox.

Fixes: 6770131e ("util: fix a memleak in mkdir_p")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1289>
2025-08-01 11:11:31 -04:00
Peter Hutterer
c1d8d92b57 Drop evdev_frame_new_on_stack()
Was unused anwyay but also cannot work, returning an address to a frame
allocated on the stack is not a great idea...

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1192>
2025-08-01 16:49:00 +10:00
Peter Hutterer
2723cadaeb lua: drop compatibility to 5.1 to allow for luajit
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1192>
2025-08-01 16:49:00 +10:00