Bug 481584

Summary: Allow stretched scaling (horizontal ratio ≠ vertical ratio) on Wayland
Product: [Plasma] kwin Reporter: Kevin Kofler <kevin.kofler>
Component: platform-drmAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: ngompa13, xaver.hugl
Priority: NOR    
Version: 5.93.0   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Kevin Kofler 2024-02-20 17:06:08 UTC
Under X11, I can scale outputs (at X11 level) ignoring the aspect ratio. This is essential to unify outputs with different aspect ratios, for presentations and meetings. E.g., my notebook has a 1280×800 (8:5/16:10) display. Using xrandr --scale-from, I can stretch this to 16:9, or even to 1024×768 4:3 which is then stretched to 16:9 by the TV. So I see the same thing on the notebook's built-in screen and on the TV, slightly distorted, but workable. (Yes, it is blurry and/or some pixels are lost. But it does not look that bad in practice.)

Today, I tried to do this trick with my PinePhone (using the convergence dock and HDMI output). Plasma Mobile forces Wayland on me. So I look at the options of kscreen-doctor, which is purportedly the replacement of xrandr, and well, that can only apply one scale factor, not different ones for horizontal and vertical. So I cannot get truly unified outputs. Instead, one or the other display ends up truncated and impossible to work with. (Also because, on mirrored configurations, Plasma insists on filling the larger display and truncating the smaller one instead of filling the smaller one and letterboxing the larger one as it should, independently of which of the displays I set to be primary.)

Ever since the introduction of the XRandR X11 extension, the one way to get my use case working has always been to talk to XRandR directly over the CLI and bypass Plasma entirely. Even fractional scaling on X11 is a non-issue if you just let X11 do the scaling, so that neither Plasma nor the applications even realize that their display is being scaled, let alone that it is being fractionally scaled with a different fraction horizontally and vertically. They just see a framebuffer of the size they want, and everything is scaled by X11/XRandR behind their back. So it just works (with the aforementioned blurriness / lost pixels, true). Unfortunately, this is not an option in Wayland because there is no X server that can do the scaling behind Plasma's back under Wayland. So for Wayland, I need KScreen to handle that stretching mode.
Comment 1 Neal Gompa 2024-02-20 17:18:26 UTC
Moving this to KWin, as this is where the code for this lives now.

I can also confirm that this is an issue on Fedora KDE 40 with Plasma 5.93 (6.0 RC2).
Comment 2 Zamundaaa 2024-02-20 22:26:22 UTC

*** This bug has been marked as a duplicate of bug 481222 ***