Bug 500124

Summary: KWin overrides drawing tablet orientation configuration whenever adding a tablet
Product: [Plasma] kwin Reporter: Arsen Arsenović <arsen>
Component: libinputAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kde, nate
Priority: NOR    
Version First Reported In: 6.3.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=509540
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Arsen Arsenović 2025-02-15 12:07:06 UTC
SUMMARY
After plugging in a drawing tablet, KWin loads its configuration, applies its orientation, but then, shortly after, calls Connection::applyScreenToDevice, which does device->setOrientation(Qt::PrimaryOrientation), thereby overriding the previously read orientation config.

My tablet is not a display tablet, so its orientation is not tied to a display.  I have it rotated so that it fits on my desk better.  I suspect the call above is not really applicable for drawing tablets without screens in them.

I've used GDB to narrow down that the applyDeviceConfig and applyScreenToDevice calls in processEvents' LIBINPUT_EVENT_DEVICE_ADDED case set the correct orientation (the one in the config file) and reset the orientation, respectively, in kwin/src/backends/libinput/connection.cpp.

STEPS TO REPRODUCE
1. Plug in a tablet
2. Set its orientation to something other than PrimaryOrientation
3. Unplug and plug the tablet back in
4. Observe the orientation

OBSERVED RESULT
Orientation is reverted to default

EXPECTED RESULT
Orientation is kept as what I set it

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux 2.17
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Kernel Version: 6.6.74-gentoo-dist (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3800X 8-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: AMD Radeon RX 6700 XT

ADDITIONAL INFORMATION
The tablet is a One by Wacom CTL-672, but I doubt this is relevant.