Ryan Hendrickson
efb4b6a3be
evdev: detect virtual devices
...
The quirk AttrIsVirtual takes precedence, if present. If not, use the
syspath of the event device to detect if it is virtual, as long as we
aren't running the test suite. (Test suite devices are all virtual, but
we should test them as if they aren't.)
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1213 >
2025-06-08 23:55:10 +00:00
Peter Hutterer
49eb6cb8ab
Move the log #defines and declarations to a separate header
...
Makes them easier to re-use as API
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1216 >
2025-06-06 13:11:34 +10:00
Peter Hutterer
d9d4d92ff0
Move libinput_now() to our timer.c helper functions
...
This is just general cleanup so libinput_now() is easier to use without
needing to include libinput-private.h (which itself opens up most of
libinput's internals).
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1216 >
2025-06-06 13:11:32 +10:00
Peter Hutterer
5774463dde
tablet: shut up deprecated declarations warnings
...
No need to see those every time, #1137 now tracks this
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1214 >
2025-06-06 11:00:04 +10:00
Peter Hutterer
46950de903
util: return early when listing files from a NULL directory list
...
For consistency with "no matching file found" return a single-null-entry
array.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1212 >
2025-06-05 00:49:57 +00:00
Peter Hutterer
d5761547da
test: add litest_log_group() for easier test log grouping
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1210 >
2025-06-04 04:07:26 +00:00
Peter Hutterer
669bc620aa
test: add helpers for private data handling in tests
...
Our litest context needs the libinput user_data but it does provide
a `private` pointer for our test data - let's reduce the boilerplate
to access that.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1211 >
2025-06-03 09:32:42 +00:00
Peter Hutterer
ec9c39da18
util: add a number of list helpers
...
The list_debug function is ifdef'd out, it'll be useful to debug
whenever we have some list corruption.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1209 >
2025-06-03 09:10:15 +00:00
Peter Hutterer
57a0a219b0
evdev: Handle MSC_SERIAL better in the event log print
...
Print it as hex and align it better in the output
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1208 >
2025-06-03 08:55:24 +00:00
Yang Kun
8fe6cc9396
quirks: modify touchpad quirk for ThinkBook G7+
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1206 >
2025-06-01 19:02:38 +08:00
Peter Hutterer
ea50e1a92c
test: add litest_assert_str_in/not_in() helpers
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Peter Hutterer
14c4667980
test: add litest_assert_not_reached()
...
Simpler than a specific litest_abort_msg() everywhere
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Peter Hutterer
e91e1c3111
util: add a tmpdir helper
...
With the __attribute__(cleanup) helper this makes it simple
enough to provide a tempdir inside a function that is (recursively)
automatically deleted when the variable is deleted.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Peter Hutterer
91d4f9e58e
util: add an rmdir_r helper function
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Peter Hutterer
efea8463fe
util: add a helper to find files in a set of directories
...
Returns a number of paths for files with a given suffix in a
priority-sorted list of directories.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Peter Hutterer
95a417cefa
util: add a helper to find substrings in a strv
...
Returns true and optionally the first index of any string in strv that
contains the given substring.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Peter Hutterer
6f28664854
util: move zalloc to util-mem.h
...
zalloc pre-dates util-mem.h but let's move it there, it makes more sense
than including util-strings.h.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Peter Hutterer
15b4ea59e9
test: improve an error message for an unlikely error
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Peter Hutterer
d5cd398b77
test: improve an error message for unhandled parameter types
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204 >
2025-05-26 05:22:33 +00:00
Benjamin Tissoires
c4b8cb6423
CI: run marge-bot pipelines as priority:high
...
The workflows.rules is copied from mesa/mesa.
When marge is running the CI, we can assign it to a higher priority
queue, allowing non marge jobs to be run after.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1205 >
2025-05-23 10:16:08 +02:00
Peter Hutterer
87e13ebb8b
CI: bump to use Fedora 42
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1199 >
2025-05-19 09:41:08 +10:00
Peter Hutterer
66d32803d3
meson.build: don't error on deprecated declarations with -Werror
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1203 >
2025-05-16 20:45:49 +10:00
Peter Hutterer
f653ce0a22
Fix links to point to the current doc pages
...
The underscored page names date back to doxygen and have been obsolete
for many years now.
Closes #1123
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1202 >
2025-05-16 05:45:51 +00:00
Benjamin Tissoires
7915921a3c
CI: replace b2c with virtme-ng
...
vng is much faster than b2c for spinning up the jobs, so better use this
instead.
Bonus point: we don't need the start-in-systemd.sh stunt.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1125 >
2025-05-14 18:22:32 +02:00
Peter Hutterer
0e67cdc4ed
gestures: rewrite the gesture state transition debugging code
...
Fixes a spurious compiler error in release builds:
cc -Ilibinput-plugin-test-suite.p -I. -I.. -I../src -I../include -I/usr/include/libevdev-1.0 -I/usr/include/libwacom-1.0 -I/usr/include/gudev-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -O3 -Wno-unused-parameter -Wmissing-prototypes -Wstrict-prototypes -Wundef -Wlogical-op -Wpointer-arith -Wuninitialized -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough -Wredundant-decls -Wincompatible-pointer-types -Wformat=2 -Wno-missing-field-initializers -Wmissing-declarations -fvisibility=hidden -Werror -pthread -MD -MQ libinput-plugin-test-suite.p/src_evdev-mt-touchpad-gestures.c.o -MF libinput-plugin-test-suite.p/src_evdev-mt-touchpad-gestures.c.o.d -o libinput-plugin-test-suite.p/src_evdev-mt-touchpad-gestures.c.o -c ../src/evdev-mt-touchpad-gestures.c
../src/evdev-mt-touchpad-gestures.c: In function ‘tp_gesture_handle_state’:
../src/evdev-mt-touchpad-gestures.c:1814:69: error: ‘%s’ directive argument is null [-Werror=format-truncation=]
1814 | int n = snprintf(&buf[slen], remaining, " → %s", gesture_state_to_str(*s));
| ^~
Apparently because gesture_state_to_str() may return null (this cannot
happen in our code) it fails with an error here. So let's rewrite it to
use our strv helpers.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1201 >
2025-05-11 23:51:10 +00:00
Peter Hutterer
97a7ab7f9d
CI: bump to Ubuntu 25.04
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1200 >
2025-05-09 17:34:52 +10:00
Peter Hutterer
40bbf8cff6
CI: update to latest ci-templates
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1200 >
2025-05-09 16:39:23 +10:00
Peter Hutterer
8177a685c2
meson.build: fix detection of C23 auto
...
Sadly, this detection was broken because in C everything defaults to
type int. Casting a const char* to int is permitted but generates a
warning which was promptly ignored by meson.
This result in HAVE_C23_AUTO being set on compilers that don't by
default have -Werror=implicit-int and "auto" ended up being just an
"int".
Change the detection to use gmtime() which returns a struct, and add a
basic test using one of our struct-returning utility functions, just to
be sure.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1198 >
2025-05-08 23:06:58 +00:00
Peter Hutterer
04975b4618
Constify libinput_config_accel_set_points()
...
We copy the contents of the double array so let's constify this.
Fixes: 5324f425a1 ("Introduce custom acceleration profile")
Closes #1114
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1195 >
2025-05-06 04:34:46 +00:00
K900
fc3868a4de
quirks: add quirk for Asus ROG Flow Z13 2025 (GZ302EA) tablet
...
The volume buttons should not be disabled in tablet mode.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1196 >
2025-05-04 12:28:34 +03:00
Peter Hutterer
d400b17bee
util: add the macros required for magic vararg expansion
...
A set of macros that expand to different things depending on the
number of arguments passed into the macro. Can be used for anything
but in the test case we use it to differ between stringifying the single
argument or taking a custom string for that same argument.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1188 >
2025-04-28 10:05:52 +10:00
Peter Hutterer
9d828ae069
CI: bump to Ubuntu 24.04
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1194 >
2025-04-24 20:17:19 +10:00
Peter Hutterer
04a55d59d9
test: call rmdir for directories, not unlink
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1193 >
2025-04-24 17:34:07 +10:00
Peter Hutterer
6563b66a92
utils: add strv_find()
...
Finds and optionally returns the index of a string in a strv
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1193 >
2025-04-24 17:34:06 +10:00
Peter Hutterer
b481170918
evdev: use autofree for the sysname
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1193 >
2025-04-24 15:31:19 +10:00
Peter Hutterer
43c4224e56
quirks: add quirk for the RazerBladeLate2020Base keyboard
...
Generated by tools/razer-quirks-lister.py
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1191 >
2025-04-17 09:56:19 +10:00
Peter Hutterer
479a3d024c
test: improve debugging for one of the tablet tests
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1185 >
2025-04-16 19:57:21 +10:00
Peter Hutterer
b2c42b60da
test: rewrite the udev seat change test
...
The previous test was prone to a race condition if multiple tests were
run in parallel: since we're using a udev context here we would see any
device added through uinput. If the DEVICE_ADDED event was from a
device added by some other test we would later fail the test because
that other device still used the default seat.
Rewrite it to use a name comparison and in the process start using the
cleanup macros.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 19:15:56 +10:00
Peter Hutterer
2487273b5e
test: use litest_dispatch() in litest_wait_for_events()
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 19:15:29 +10:00
Peter Hutterer
5c1c14e567
test: parametrize some of the misc tests
...
This fixes an issue with the abs_device_missing_res tests where we only
tested for the X axis without a res.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
c9b92d9b6b
test: use __attribute__(cleanup) in udev tests
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
a19671d0da
Use _unref_ for the udev handling in path and udev seat implementations
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
d72df04e7d
test: auto-unref the litest devices
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
cefab21e42
util: add an _unused_ macro and replace LIBINPUT_UNUSED
...
For annotating intentionally used variables it needs to be a bit
shorter, so let's replace the current one which was aimed at functions.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
6cbe4568de
test: rename litest_delete_device to litest_device_destroy
...
To be closer to the common free/destroy/unref pattern
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
6f6bba9588
test: use __attribute__(cleanup) for the test libinput contexts
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
34b3881d24
test: remove an unused variable in the totem tests
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
923e8e43db
test: use __attribute__(cleanup) in the switch tests
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
1ae9462366
test: use __attribute__(cleanup) in the path tests
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
74e6b97d1e
test: use __attribute__(cleanup) in litest
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00