Bug 521464 - Udev rules for LIBINPUT_CALIBRATION_MATRIX do not work on wayland
Summary: Udev rules for LIBINPUT_CALIBRATION_MATRIX do not work on wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: libinput (other bugs)
Version First Reported In: 6.6.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2026-06-14 12:47 UTC by Liarus1001
Modified: 2026-07-20 19:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.6
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liarus1001 2026-06-14 12:47:18 UTC
DESCRIPTION

Udev rules for LIBINPUT_CALIBRATION_MATRIX do not work on wayland, they work on the plasma's x11 session.

I have a device that has a touchscreen that is rotated by 180°, i use this udev rule to fix it:

ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"

That rule works fine on x11 but doesn't work on wayland.



STEPS TO REPRODUCE
1. Apply the udev rule
2. reboot the computer
3. login again

OBSERVED RESULT

Touchscreen input is not working

EXPECTED RESULT

Touchscreen input should be rotated by 180°


SOFTWARE/OS VERSIONS

Operating System: CachyOS Linux 
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Kernel Version: 7.0.11-1-cachyos (64-bit)
Graphics Platform: offscreen
Processors: 4 × Intel® Celeron® N5095 @ 2.00GHz
Memory: 16 GiB of RAM (15.4 GiB usable)


ADDITIONAL INFORMATION

The behavior can be replicated on other Wayland environments, it also works fine on other x11 desktop environments.
Comment 1 Nicolas Fella 2026-06-16 09:34:09 UTC
Please paste the output of "sudo libinput list-devices"
Comment 2 Liarus1001 2026-06-16 18:47:10 UTC
(In reply to Nicolas Fella from comment #1)
> Please paste the output of "sudo libinput list-devices"

Hello, here is the output, with the udev rule shown before:

❯ cat /etc/udev/rules.d/99-gole2pro-touch.rules
ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"

~ liarus@LIARUS-MN
❯ sudo libinput list-devices
[sudo] password for liarus: 
Device:                  Goodix Capacitive TouchScreen
Kernel:                  /dev/input/event8
Id:                      i2c:0416:038f
Group:                   1
Seat:                    seat0, default
Capabilities:            keyboard touch 
Tap-to-click:            n/a
Tap-and-drag:            n/a
Tap button map:          n/a
Tap drag lock:           n/a
Left-handed:             n/a
Nat.scrolling:           n/a
Middle emulation:        n/a
Calibration:             -1.00 0.00 1.00 0.00 -1.00 1.00
Scroll methods:          none
Scroll button:           n/a
Scroll button lock:      n/a
Click methods:           none
Clickfinger button map:  n/a
Disable-w-typing:        n/a
Disable-w-trackpointing: n/a
Accel profiles:          n/a
Rotation:                0.0
Area rectangle:          n/a


________

If i remove the rule and reboot it goes back to "Calibration:             identity matrix"
i assume that's what you want to look at ?
Comment 3 Liarus1001 2026-06-22 14:37:25 UTC
FYI, i tried to report the bug to libinput but they said it is a compositor bug: https://gitlab.freedesktop.org/libinput/libinput/-/work_items/1303
Comment 4 Nicolas Fella 2026-06-30 11:05:57 UTC
> i assume that's what you want to look at ?

yes, thanks. It shows that libinput picks up the value from udev.

KWin doesn't seem to process it correctly
Comment 5 Bug Janitor Service 2026-06-30 12:21:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/9503
Comment 6 Vlad Zahorodnii 2026-07-06 09:28:25 UTC
Git commit 43d0850ddb704c7b1bc8113dba645d955e8a318f by Vlad Zahorodnii, on behalf of Nicolas Fella.
Committed on 06/07/2026 at 09:28.
Pushed by vladz into branch 'master'.

libinput: Fix Device::serializeMatrix

QMatrix4x4's ctor accepts data in row-major order, but constData() returns column-major order

This means that serialize and deserialize are inconsistent

Fix serialize to also work on row-major order

M  +12   -0    autotests/libinput/device_test.cpp
M  +8    -4    src/backends/libinput/device.cpp

https://invent.kde.org/plasma/kwin/-/commit/43d0850ddb704c7b1bc8113dba645d955e8a318f
Comment 7 Vlad Zahorodnii 2026-07-06 10:23:51 UTC
Git commit 88f88971326600923329c3542ade808c35d0b703 by Vlad Zahorodnii.
Committed on 06/07/2026 at 10:23.
Pushed by vladz into branch 'Plasma/6.7'.

libinput: Fix Device::serializeMatrix

QMatrix4x4's ctor accepts data in row-major order, but constData() returns column-major order

This means that serialize and deserialize are inconsistent

Fix serialize to also work on row-major order


(cherry picked from commit 43d0850ddb704c7b1bc8113dba645d955e8a318f)

Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>

M  +12   -0    autotests/libinput/device_test.cpp
M  +8    -4    src/backends/libinput/device.cpp

https://invent.kde.org/plasma/kwin/-/commit/88f88971326600923329c3542ade808c35d0b703
Comment 8 Vlad Zahorodnii 2026-07-06 10:35:40 UTC
Git commit 11762f5aa28ed5bcd53faec3021fefb8c49b7e36 by Vlad Zahorodnii.
Committed on 06/07/2026 at 10:35.
Pushed by vladz into branch 'Plasma/6.6'.

libinput: Fix Device::serializeMatrix

QMatrix4x4's ctor accepts data in row-major order, but constData() returns column-major order

This means that serialize and deserialize are inconsistent

Fix serialize to also work on row-major order


(cherry picked from commit 43d0850ddb704c7b1bc8113dba645d955e8a318f)

Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>

M  +12   -0    autotests/libinput/device_test.cpp
M  +8    -4    src/backends/libinput/device.cpp

https://invent.kde.org/plasma/kwin/-/commit/11762f5aa28ed5bcd53faec3021fefb8c49b7e36