<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>521464</bug_id>
          
          <creation_ts>2026-06-14 12:47:18 +0000</creation_ts>
          <short_desc>Udev rules for LIBINPUT_CALIBRATION_MATRIX do not work on wayland</short_desc>
          <delta_ts>2026-07-20 19:11:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>libinput</component>
          <version>6.6.5</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=519392</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>wayland-only</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>Liarus1001</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>nate</cc>
    
    <cc>nicolas.fella</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/kwin/-/commit/11762f5aa28ed5bcd53faec3021fefb8c49b7e36</cf_commitlink>
          <cf_versionfixedin>6.6.6</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2522965</commentid>
    <comment_count>0</comment_count>
    <who name="">Liarus1001</who>
    <bug_when>2026-06-14 12:47:18 +0000</bug_when>
    <thetext>DESCRIPTION

Udev rules for LIBINPUT_CALIBRATION_MATRIX do not work on wayland, they work on the plasma&apos;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}=&quot;-1 0 1 0 -1 1&quot;

That rule works fine on x11 but doesn&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2523420</commentid>
    <comment_count>1</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2026-06-16 09:34:09 +0000</bug_when>
    <thetext>Please paste the output of &quot;sudo libinput list-devices&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2523578</commentid>
    <comment_count>2</comment_count>
    <who name="">Liarus1001</who>
    <bug_when>2026-06-16 18:47:10 +0000</bug_when>
    <thetext>(In reply to Nicolas Fella from comment #1)
&gt; Please paste the output of &quot;sudo libinput list-devices&quot;

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

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

~ 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 &quot;Calibration:             identity matrix&quot;
i assume that&apos;s what you want to look at ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2525643</commentid>
    <comment_count>3</comment_count>
    <who name="">Liarus1001</who>
    <bug_when>2026-06-22 14:37:25 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2528325</commentid>
    <comment_count>4</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2026-06-30 11:05:57 +0000</bug_when>
    <thetext>&gt; i assume that&apos;s what you want to look at ?

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

KWin doesn&apos;t seem to process it correctly</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2528351</commentid>
    <comment_count>5</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2026-06-30 12:21:54 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/9503</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2529538</commentid>
    <comment_count>6</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2026-07-06 09:28:25 +0000</bug_when>
    <thetext>Git commit 43d0850ddb704c7b1bc8113dba645d955e8a318f by Vlad Zahorodnii, on behalf of Nicolas Fella.
Committed on 06/07/2026 at 09:28.
Pushed by vladz into branch &apos;master&apos;.

libinput: Fix Device::serializeMatrix

QMatrix4x4&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2529546</commentid>
    <comment_count>7</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2026-07-06 10:23:51 +0000</bug_when>
    <thetext>Git commit 88f88971326600923329c3542ade808c35d0b703 by Vlad Zahorodnii.
Committed on 06/07/2026 at 10:23.
Pushed by vladz into branch &apos;Plasma/6.7&apos;.

libinput: Fix Device::serializeMatrix

QMatrix4x4&apos;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 &lt;nicolas.fella@gmx.de&gt;

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

https://invent.kde.org/plasma/kwin/-/commit/88f88971326600923329c3542ade808c35d0b703</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2529550</commentid>
    <comment_count>8</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2026-07-06 10:35:40 +0000</bug_when>
    <thetext>Git commit 11762f5aa28ed5bcd53faec3021fefb8c49b7e36 by Vlad Zahorodnii.
Committed on 06/07/2026 at 10:35.
Pushed by vladz into branch &apos;Plasma/6.6&apos;.

libinput: Fix Device::serializeMatrix

QMatrix4x4&apos;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 &lt;nicolas.fella@gmx.de&gt;

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

https://invent.kde.org/plasma/kwin/-/commit/11762f5aa28ed5bcd53faec3021fefb8c49b7e36</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>