Commit graph

185 commits

Author SHA1 Message Date
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
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
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
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
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
Peter Hutterer
9e37bc0cfa plugins: add support for lua plugins to change evdev event streams
This patch adds support for Lua scripts to modify evdev devices and
event frames before libinput sees those events.

Plugins in Lua are sandboxed and restricted in what they can do: no IO,
no network, not much of anything else.

A plugin is notified about a new device before libinput handles it and
it can thus modify that device (changes are passed through to our libevdev
context). A plugin can then also connect an evdev frame handler which
gives it access to the evdev frames before libinput processes them. The
example plugin included shows how to swap left/right mouse buttons:

    libinput:register({1})

    function frame(device, frame)
        for _, v in ipairs(frame.events) do
            if v.usage == evdev.BTN_RIGHT then
                v.usage = evdev.BTN_LEFT
            elseif v.usage == evdev.BTN_LEFT then
                v.usage = evdev.BTN_RIGHT
            end
        end
        return frame
    end

    function device_new(plugin, device)
        local usages = device:usages()
        if usages[evdev.BTN_LEFT] and usages[evdev.BTN_RIGHT] then
            device:connect("evdev-frame", frame)
        end
    end

    libinput:connect("new-evdev-device", device_new)

A few other example plugins are included in this patch

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1192>
2025-08-01 16:04:09 +10:00
Peter Hutterer
a22883f7e2 CI: don't run the wayland-web job for marge
marge doesn't have sufficient permissions to trigger the pipeline, so
all we get is every trigger job failing. Let's disable this until it can
be figured out properly.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1287>
2025-08-01 03:46:22 +00:00
Peter Hutterer
b8651d798c tools: add a debug-tablet-pad tool
A simple tool to check the evdev and libinput events from a tablet pad.
This is near-identical to the existing debug-tablet tool but adjusted
for tablet pad events.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1280>
2025-07-28 23:40:33 +00:00
Peter Hutterer
18b34d0bc0 test: split some tablet tests into new groups
Our CI pipeline fails 9 times out of 10 on the valgrind tests. The tests
seem to finish in either 35 min or exceed the 60 min timeout limit, with
nothing in between. To avoid this let's split into more groups so we can
a) run those more in parallel and b) are less likely to hit the
timeout when run slowly.

Analysis of recent logs shows the eraser button tests to be the worst
offender, taking 752s (due to the combinatorial explosion) alone. The
various tip and proximity tests together also take some time so let's
group those out.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1274>
2025-07-17 00:16:02 +00:00
Peter Hutterer
ccc798808a ci: don't paper over pre-commit failures
The ruff-format check only checks, it doesn't modify the files so our
CI doesn't catch formatting errors.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1272>
2025-07-15 16:26:59 +10:00
Peter Hutterer
e5e41ce7f5 CI: drop the separate python-format job
This is handled as part of the pre-commit hooks now which will also
ensure that we have the same version of ruff everywhere.

Fixes: a61c876412 ("pre-commit: drop black, use ruff-format instead")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1259>
2025-07-09 00:13:00 +00:00
Peter Hutterer
7135c2fc0c CI: retry valgrind jobs on failure
90% of failed valgrind jobs are caused by a race condition when a runner
is too slow. Instead of waiting for someone to click the retry button
let's just retry immediately again.

This could be fine-tuned to check for valgrind errors vs test suite
errors but for now this should do.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1257>
2025-07-02 12:46:50 +00:00
Peter Hutterer
27f4b0ae74 Move mtdev into a plugin
mtdev is used only for MT Protocol A device of which there are quite
few. But that protocol is also a perfect example for event frames in ->
different event frame out so let's move this into the plugin pipeline.

Because the plugin doesn't really have full access to the device's
internals we set up mtdev base on the libevdev information rather than
just handing it the fd and letting it extract the right info.

A minor functionality change: previously mtdev-backed devices returned
zero on libinput_device_touch_get_touch_count(). Now it is hardcoded to
10 - the number of callers that care about this is likely near zero.

Because it's now neatly factored out into a plugin we can also make
mtdev no longer a strict requirement.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1245>
2025-07-02 06:53:05 +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
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
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
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
436eb42044 CI: check for empty lines between closing braces
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1190>
2025-04-16 11:44:09 +10:00
Peter Hutterer
bf67c056df CI: replace the scan-build job with a clang-tidy job
Drop the scanbuild wrappers, especially the junit conversion script
which's results haven't been looked at for ages.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1182>
2025-04-07 08:43:36 +00:00
Peter Hutterer
0cc1e651d8 CI: disable docs on the arch build
Apparently python-recommonmark has moved to the AUR and it's not worth
the extra effort of figuring out how to install it.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1176>
2025-04-03 23:40:17 +00:00
Peter Hutterer
552728f957 CI: bump to FreeBSD 14.2
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1176>
2025-04-03 23:40:17 +00:00
Peter Hutterer
dd78765674 pre-commit: add a hook for checking for duplicate empty lines
It's a bit annoying to only find those during a CI pipeline run, so
let's add a hook for it. Pre-commit doesn't seem to have something
useful for duplicate line detection so let's hack up a quick script
that can do this for us, together with the other whitespace checks in
the CI so we're consistent.

Excluded from the duplicate line checks are anything "Not C" and the
"include/" directory since we don't control those files.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1154>
2025-03-11 11:41:34 +00:00
Peter Hutterer
58315eb9d4 test: remove duplicate empty lines from the test/ directory
We've had a CI job for checking this since but it omitted the test
directory.

Fixes: bb6ff0ec00 ("gitlab CI: add a job to check for whitespace issues")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1154>
2025-03-11 11:41:34 +00:00
Peter Hutterer
e68d80b13b CI: bump to Fedora 41
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1111>
2024-12-23 07:17:31 +00:00
andeston
c65e0e2a06 Update b2c sha
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1086>
2024-12-04 02:02:12 -05:00
Peter Hutterer
3b85a4017d CI: update to latest ci-templates
This allows for gitlab private emails in commit messages.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1087>
2024-12-03 23:11:59 +00:00
Peter Hutterer
74af5cfb9c CI: collect valgrind log files too
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
2024-10-30 23:20:42 +00:00
Peter Hutterer
c6ba3e2eb8 CI: disable forking for valgrind tests
With the new test suite runner we get one fork per test which will
eventually slow down valgrind enough so our tests fail.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
2024-10-30 23:20:42 +00:00
Peter Hutterer
b34010bf4e test: split the touchpad tests into a palm and a dwt test collection
dwt and palm tests have a lot of timeouts to wait for so let's split
those out.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
2024-10-18 10:49:47 +10:00
Peter Hutterer
9e00d09b30 test: split the tablet left-handed tests out into a separate collection
These aren't complicated but there's a lot of them so let's run them
separately to make the overall tablet test shorter.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
2024-10-18 10:49:47 +10:00
Peter Hutterer
532932d8aa CI: move the "device" test suite to the "misc" set of suites
That one is still with the gestures but only takes 1-2 minutes, the
gestures takes 13 minutes. Let's move it to misc which currently has an
overall runtime of only 2 min anyway.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
2024-10-18 10:49:47 +10:00
Peter Hutterer
a67dbefc0f test: split out the touchpad tap tests into multiple collections
These take a long time and have a reasonable high chance of failure due
to the timing constraints. Let's split them up so they don't hog the
runners for that long and in case they fail, we only need to re-run a
short test.

Before: one test running approx 21 min, now 3 tests running approx 7 +
11 + 4 min.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
2024-10-18 10:49:47 +10:00
Peter Hutterer
0135b0b41c test: detach the suite handling from the file names
Instead of extracting the suite name from the test's file name use the
current suite that is being parsed. This way we pave the way for
multiple suites in the same file.

This uses a global because otherwise we'd have to redo all the
litest_add() functions but it does the job here.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
2024-10-18 10:49:47 +10:00
Peter Hutterer
1c80605d56 CI: set the LITEST_JOBS in the template, not the script
Fixes: 70c57e9644 ("CI: drop the job count for the valgrind test suite to 2")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1063>
2024-10-17 15:14:02 +10:00
Peter Hutterer
b43061694c CI: skip the valgrind tests for marge-bot
marge-bot rebases and edits the commit message but there's not way for
it to introduce a memleak that wasn't spotted in the user pipeline
first. Since those tests are very flaky, let's skip them when running
the marge-bot pipeline.

Closes #1042

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1057>
2024-09-30 17:30:53 +00:00
Peter Hutterer
83be519fc2 CI: retry valgrind jobs if they fail
Our valgrind jobs are very timing-sensitive so it's very common that
they fail with an error when the reason is just valgrind being slower
and we miss a deadline somewhere.

Retry them if they fail, hopefully that gives us more reliable
pipelines.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1040>
2024-09-11 04:58:52 +00:00
José Expósito
ee9043d6b4 CI: Run pre-commit hooks
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1036>
2024-09-03 09:51:41 +02:00
Peter Hutterer
99647b71d3 tools: add libinput analyze buttons for button state analysis
This tool helps with tracking button states and time deltas
between button events. Example output for a mouse with LMR buttons
recorded (the mouse also has BTN_SIDE and BTN_EXTRA):

  Timestamp   │  Delta   │ L │ R │ M │ S │ E
     0.596112 │      0ms │ ┬ │   │   │   │
     0.689096 │     92ms │ ┴ │   │   │   │
     1.129056 │    439ms │ ┬ │   │   │   │
     1.308178 │    179ms │ ┴ │   │   │   │
     1.469149 │      0ms │ ┬ │   │   │   │
     1.598096 │    128ms │ ┴ │   │   │   │
     1.862125 │    264ms │ ┬ │   │   │   │
     2.084234 │    222ms │ │ │ ┬ │   │   │
     2.415224 │    330ms │ │ │ ┴ │   │   │
     2.831227 │    416ms │ │ │ ┬ │   │   │
     3.215067 │    383ms │ ┴ │ │ │   │   │
     3.525230 │    310ms │ ┬ │ │ │   │   │
     3.629006 │    103ms │ ┴ │ │ │   │   │
     3.813078 │    184ms │ ┬ │ │ │   │   │
     3.909170 │     96ms │ ┴ │ │ │   │   │
     4.093180 │    184ms │ ┬ │ │ │   │   │
     4.317036 │    223ms │ ┴ │ │ │   │   │
     4.507175 │    190ms │ ┬ │ │ │   │   │
     4.587105 │     79ms │ │ │ ┴ │   │   │
     4.779211 │    192ms │ ┴ │   │   │   │
     5.075239 │    296ms │   │   │ ┬ │   │
     5.259097 │    183ms │   │   │ ┴ │   │
     5.379082 │    119ms │   │   │ ┬ │   │
     5.483044 │    103ms │   │   │ ┴ │   │

The default behavior is to highlight time deltas below 25ms
in red. 25ms is our higher debounce timeout.

Note that the delta time is the one between button events, ignoring any
e.g. motion events in between.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1010>
2024-06-18 07:43:02 +00:00
Peter Hutterer
430c1b89c6 CI: bump to Fedora 40
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1000>
2024-05-13 11:19:21 +10:00
Peter Hutterer
ace22ad0b0 gitlab CI: don't run MR pipelines in forks
Commit originally by Simon Ser in wayland/wayland-protocols!305.

Currently our CI setup has a downside: for each push on a merge
request, two pipelines are triggered. The first is triggered in
the context of the forked repository, and the second is triggered
in the context of the MR in the parent repository.

Replace the workflow rules with the ones in the official docs [1],
so that a branch pipeline isn't triggered when a MR exists for that
branch.

[1]: https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/993>
2024-04-29 14:50:07 +10: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
399ba5e0ee CI: only check the MR if we're in a merge request pipeline 2024-02-28 18:53:25 +10:00
Benjamin Tissoires
ec0421d0ad CI: bump vm2c and kernel for VMs
Actually libinput is one of the last users of harbor.fd.o, because it uses
an outdated version of vm2c.py. Use the new location of the project,
bump its release, and also bump the kernel version we test while at it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2023-11-16 14:25:10 +00:00
José Expósito
12bb7547f9 meson: Use the meson setup command
Meson recommends using the `meson setup [options]` command:

    WARNING: Running the setup command as `meson [options]` instead of
    `meson setup [options]` is ambiguous and deprecated.

Update the documentation and CI to use the recommended command.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2023-09-03 17:01:59 +00:00
Peter Hutterer
f617b414fb Drop the Signed-off-by requirement
We've had this for roughly 10y now and it's value is dubious. Most of
xorg no longer requires, mesa accepts but doesn't require it, most of GNOME
doesn't accept it and neither does systemd.

Let's drop the requirement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-07-21 09:08:46 +10:00
Peter Hutterer
4bdec007ba CI: add a comment to the meson build helper
We now have an upstream for it so we can sync changes between projects.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-30 15:17:14 +10:00
Peter Hutterer
a9f4fdde0e CI: update to use Fedora 38
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-20 09:51:49 +10:00