Bug 491725

Summary: Subsurface Rounding Issues on KWIN Wayland with wp-fractional-scale-v1,
Product: [Plasma] kwin Reporter: dofficialgman
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: michel, nate, xaver.hugl
Priority: NOR    
Version First Reported In: 6.1.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description dofficialgman 2024-08-14 18:30:55 UTC
SUMMARY
Previously mentioned in https://bugs.kde.org/show_bug.cgi?id=479891#c8 however this bug is unrelated to the title of that bug and should be separate.


STEPS TO REPRODUCE
1. compile the test program

git clone https://git.sr.ht/~vyivel/aligned-scale-test
cd aligned-scale-test/
meson build/
meson compile -C build/

2. set the scaling to 100% to see correct output
3. build/aligned-scale-test -f 

4. set the scaling to any fractional scale to see incorrect (overlapping and spaces) output
5. build/aligned-scale-test -f 

OBSERVED RESULT
https://bugs.kde.org/show_bug.cgi?id=479891#c11

EXPECTED RESULT
https://bugs.kde.org/show_bug.cgi?id=479891#c9

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 24.04
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0 
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Comment 1 Zamundaaa 2024-08-15 12:57:27 UTC
fractional-scale-v1 inherently doesn't work with subsurfaces, and states that
> The  rounding algorithm for subsurface position and size is not defined.

as no rounding algorithm can make it work properly. This is not something we can fix in an implementation.
Comment 2 dofficialgman 2024-08-15 13:03:08 UTC
(In reply to Zamundaaa from comment #1)
> fractional-scale-v1 inherently doesn't work with subsurfaces, and states that
> > The  rounding algorithm for subsurface position and size is not defined.
> 
> as no rounding algorithm can make it work properly. This is not something we
> can fix in an implementation.

According to the post mentioned in the summary link https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/143#note_1343171 you can fix in an implementation (and wlroots and mutter have already done so).
Reading the mutter PR (merged 1 year ago) may help with KDE fixing this issue https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2726
Comment 3 Zamundaaa 2024-08-15 14:28:23 UTC
It can't be fixed, you can only choose a different tradeoff: gaps or blurriness.
The test client is not something to fixate on, as normal apps do not adjust their subsurface positions and sizes to match the weird oddities of the Wayland protocol.