Bug 504613

Summary: Kwin confuses applications about screen height/width when screen is rotated
Product: [Plasma] kwin Reporter: Sergio <sergio.callegari>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: xaver.hugl
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sergio 2025-05-21 13:44:50 UTC
SUMMARY

Some wayland applications appear to think that when the display is rotated the screen width is the screen height.

To give a bit of a context. I have a tablet/convertible where the "normal" screen orientation is with a vertical screen. Hence, to use it as a laptop, the screen must be rotated. When one works using the device as a laptop, the screen width is obviously larger than the height.

Now, there are some applications that apparently get confused about the rotation.

- **Wine**. Running wine in X11 mode under xwayland, it works fine. However, running it in wayland mode, when you try to resize the application windows dragging their border, the window does not expand horizontally more to the right than a position that corresponds to the screen height.  If you maximize the application via the kwin maximize function, it gets to the full screen, but the decorations on the right are missing and the right part of the application window misbehaves.

On other computers, with exactly the same plasma/kwin/wine configuration, wine works fine in wayland mode.

- **Waypipe**. Running the waypipe client I see a strange issue when on the "other" (server) side I run X11 applications with xwayland-satellite. In this case, everything is shown correctly. However, the mouse works correctly only as long as the application is not maximized. In this case, when the mouse cursor is on the right side of the display, the application "perceives" the position as if it was on a virtual boundary corrisponding to a coordinate equivalent to the screen height.

Now, these might well be issues with wine or waypipe. However, it is strange that they happen in conjunction the screen rotation practiced by kwin/kscreen. 

STEPS TO REPRODUCE
1. Get a system where the normal screen rotation has width < height
2. Rotate the screen, so that width > height
3. launch env -u DISPLAY wine with some application (tried with ltspice)

OBSERVED RESULT

Cannot maximize the application width by dragging the border. If maximized via kwin, does not work properly anymore.

EXPECTED RESULT

The application works even when trying to set a window width > than the unrotated screen width (aka the screen height).

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.12.28-1-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Celeron® N4120 CPU @ 1.10GHz
Memory: 5.6 GiB of RAM
Graphics Processor: Intel® UHD Graphics 600
Manufacturer: CHUWI Innovation And Technology(ShenZhen)co.,Ltd
Product Name: Hi10 X

ADDITIONAL INFORMATION
Comment 1 Zamundaaa 2025-05-21 13:55:58 UTC
I checked, and KWin is definitely sending the correct logical size and rotation. Please report this to the misbehaving applications - presumably they're looking at the modes (which they shouldn't), and ignore that they need to rotate them to match the output rotation.
Comment 2 Sergio 2025-05-21 14:16:24 UTC
Thanks for this check!
Comment 3 Sergio 2025-05-21 14:30:18 UTC
And I would like to confirm that you are totally right. E.g., at least for xwayland-satellite I have just verified that this is a recent regression.