Bug 512672

Summary: Wacom display tablet mapping to screen not capped to bounds
Product: [Plasma] kwin Reporter: Julien Kaspar <julien>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: 6.5.3   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.5.4
Sentry Crash Report:
Attachments: Video recording to demonstrate the issue

Description Julien Kaspar 2025-11-27 10:37:27 UTC
Created attachment 187203 [details]
Video recording to demonstrate the issue

SUMMARY
When I'm using my Wacom Cintiq 16 display pen tablet it is not mapped to the screen correctly.
In the settings I set it to be mapped to the entire screen, but when using the pen, it will go outside of the bounds of the screen when the pen goes outside of the display tablet area.
I was surprised to see the Wacom tablet can actually detect the pen outside of the bounds of its surface area.
But it seems like there are no measures in place in KDE to restrict that.

Interestingly when using the same tablet and settings on X11, the cursor position is capped to the bounds of the screen. It will not go outside to the neighboring screens.

This issue with wayland leads to various issues:
- Window that was worked on can lose focus
- Mouse release event (lifting the pen) will not be registered by the active window if the cursor leaves the screen
- When using the setting to map the tablet to the active screen, it will easily swap screens because the cursor can accidentally go out of bounds 

OBSERVED RESULT
(See video attachment)
The pen tablet cursor is not capped to the mapped screen dimensions.

EXPECTED RESULT
The pen tablet cursor should be restricted to the screen and dimensions in the settings (like in X11)

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux 2.18
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.1
Kernel Version: 6.17.9-gentoo-dist (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen Threadripper 1950X 16-Core Processor
Memory: 96 GiB of RAM (94,2 GiB usable)
Graphics Processor: AMD Radeon RX 7900 XT
Product Name: PRIME X399-A
Comment 1 Bug Janitor Service 2025-11-27 20:12:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8494
Comment 2 Zamundaaa 2025-11-28 12:08:48 UTC
Git commit fe6293e595568d19599cec41a4a13e4d9e9dcb40 by Xaver Hugl.
Committed on 28/11/2025 at 11:42.
Pushed by zamundaaa into branch 'master'.

backends/libinput: clamp tablet and touch coordinates to target output

Apparently, some devices can trigger events outside of their normal bounds, and that
can have some problematic side-effects, like unintentionally changing the active output.

M  +4    -1    src/backends/libinput/connection.cpp

https://invent.kde.org/plasma/kwin/-/commit/fe6293e595568d19599cec41a4a13e4d9e9dcb40
Comment 3 Zamundaaa 2025-11-28 12:47:57 UTC
Git commit ebbf42acae0207468db74c3b2cf8f4d7b69d5e74 by Xaver Hugl.
Committed on 28/11/2025 at 12:10.
Pushed by zamundaaa into branch 'Plasma/6.5'.

backends/libinput: clamp tablet and touch coordinates to target output

Apparently, some devices can trigger events outside of their normal bounds, and that
can have some problematic side-effects, like unintentionally changing the active output.


(cherry picked from commit fe6293e595568d19599cec41a4a13e4d9e9dcb40)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +4    -1    src/backends/libinput/connection.cpp

https://invent.kde.org/plasma/kwin/-/commit/ebbf42acae0207468db74c3b2cf8f4d7b69d5e74