Bug 474666

Summary: On a wayland session fonts look horrible when global scaling is active
Product: [Plasma] kwin Reporter: Timo Gurr <timo.gurr>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, xaver.hugl
Priority: NOR    
Version First Reported In: 5.27.8   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.0
Sentry Crash Report:
Attachments: display_settings_wayland.png
display_settings_x11.png
system_settings_wayland.png
system_settings_x11.png

Description Timo Gurr 2023-09-18 20:24:30 UTC
Created attachment 161704 [details]
display_settings_wayland.png

SUMMARY
I hope I picked the right component and kwin is actually doing the global scaling, if not please move this bug to the respective component as I have no idea of the actual technical implementation, thank in advance.

When logging in to a wayland session and setting the global scaling to 125% like I do on X11 the fonts look horrible compared to X11. 

STEPS TO REPRODUCE
1. Have a 2k monitor
2. Log into a wayland session
3. Set global scaling to 125%

OBSERVED RESULT
Fonts look horrible like eroded or frayed compared to X11. Also the font spacing is different, like can be seen on the last item of the menu on the left side "Über dieses System" where the spacing between Üb<->er is too narrow and not consistent between the letters.

EXPECTED RESULT
Font looking "normal" sharp and crisp and easily readable like on a X11 session with global scaling set to 125%.

SOFTWARE/OS VERSIONS

Operating System: Exherbo 
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.3 (64-bit)
Graphics Platform: Wayland / X11
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
Attaching screenshots to illustrate the problem, while they might look ok on the first look try comparing them and you probably see the difference, it might not look that bad but compared to X11 it really hurts the eyes.
Comment 1 Timo Gurr 2023-09-18 20:24:43 UTC
Created attachment 161705 [details]
display_settings_x11.png
Comment 2 Timo Gurr 2023-09-18 20:24:55 UTC
Created attachment 161706 [details]
system_settings_wayland.png
Comment 3 Timo Gurr 2023-09-18 20:25:05 UTC
Created attachment 161707 [details]
system_settings_x11.png
Comment 4 Zamundaaa 2023-09-19 12:17:50 UTC
You need to log out and log in again before Qt renders correctly with changed scaling. This is fixed in Plasma 6
Comment 5 Nate Graham 2023-09-19 18:19:44 UTC
I appreciate you taking screenshots that are pixel-for-pixel identical onX11 vs Wayland except for the text. That was very helpful.

In a nutshell, fractional scaling on Qt5 Wayland is less than ideal compared to X11. It's already fixed in Qt 6, though.
Comment 6 Timo Gurr 2023-09-20 18:34:39 UTC
(In reply to Zamundaaa from comment #4)
> You need to log out and log in again before Qt renders correctly with
> changed scaling. This is fixed in Plasma 6

I did logout and back in before taking the screenshots, actually I even restarted the whole machine after every change.

(In reply to Nate Graham from comment #5)
> I appreciate you taking screenshots that are pixel-for-pixel identical onX11
> vs Wayland except for the text. That was very helpful.
> 
> In a nutshell, fractional scaling on Qt5 Wayland is less than ideal compared
> to X11. It's already fixed in Qt 6, though.

Thanks for the clarification, I guess I'll have to wait until February then for the KDE Plasma version based on Qt6 to arrive to be able to switch from a X11 to a Wayland session. I read your wayland articles and finally got an amd gpu together with a new 2k monitor so I thought I could do the switch right away. I'm glad to hear that it is already fixed for the Qt6 based KDE Plasma, looking very much forward to it.