Bug 470979

Summary: Stylus input does not work properly with changes in display orientation
Product: [Plasma] kwin Reporter: jeast <trashandspam12>
Component: inputAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: xaver.hugl
Priority: NOR    
Version First Reported In: git-stable-Plasma/5.27   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description jeast 2023-06-13 13:35:16 UTC
SUMMARY
When the display orientation is anything but the default, the stylus cursor appears in the wrong location. For example, if I rotate the orientation 180 degrees and hover the stylus near my keyboard, the cursor appears on the other side of the screen, near my camera.

This is almost exactly like a previous bug reported in 2020 (https://bugs.kde.org/show_bug.cgi?id=423799). This bug is marked as resolved, fixed in KDE Plasma version 5.20. However, I am using a more recent version (5.27.5) and am still observing the bug.

I found another similar bug report for Arch Linux (https://bugs.archlinux.org/task/65950), but it was not resolved.

STEPS TO REPRODUCE
1. Open the 'System Settings' application
2. Navigate to the 'Display and Monitor' section
3. Choose any non-default orientation option
4. Attempt to use the stylus.

OBSERVED RESULT
The cursor will appear in the wrong location on the screen. The stylus will treat the part of the screen closest to the keyboard as the bottom of the screen in any display orientation.

EXPECTED RESULT
I expect the cursor to appear directly beneath my physical stylus, regardless of display orientation.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: EndeavorOS 
KDE Plasma Version: 5.27.5 
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
Machine: HP ENVY x360 2-in-1 Laptop 15-ey0xxx
Stylus: Microsoft Surface Pen - EYU00041
Comment 1 Zamundaaa 2023-06-13 14:22:41 UTC
Are you on X11 or Wayland? The stylus is properly handled for me on 5.27 with Wayland, with all possible screen rotations
Comment 2 jeast 2023-06-13 14:34:55 UTC
(In reply to Zamundaaa from comment #1)
> Are you on X11 or Wayland? The stylus is properly handled for me on 5.27
> with Wayland, with all possible screen rotations

I was on X11, but I switched to Wayland and it works properly now! Thanks for your help, I kinda feel silly now for overlooking that in your bug report.

This is a perfectly acceptable fix for me, but should I leave this bug report open since it still exists on X11? The issue reporting guidelines don't really give instructions for a situation like this.
Comment 3 Zamundaaa 2023-06-13 15:14:51 UTC
KWin isn't responsible for such things on X11, and I don't know who would be responsible for it (KScreen, or the Wacom KCM stuff?). So let's just close it. If someone cares about it, they can always open a bug report in the appropriate place themselves