Bug 477438

Summary: GTK apps using wp_fractional_scale_manager_v1 look blurry
Product: [Plasma] kwin Reporter: Iván Ávalos <ivan>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: kde
Priority: NOR    
Version First Reported In: 5.27.9   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: GNOME Clocks with wp_fractional_scale_manager_v1
GNOME Clocks without wp_fractional_scale_manager_v1
Firefox without wp_fractional_scale_manager_v1
Firefox with wp_fractional_scale_manager_v1
Telegram rendering at 100% in Wayland

Description Iván Ávalos 2023-11-23 21:44:56 UTC
SUMMARY
I've been trying the experimental wp_fractional_scale_manager_v1 support to see if things looked sharper, and was surprised to see it perform much worse than downscaling. Apps using this protocol look blurry, and in the case of Firefox, some UI elements even break.

STEPS TO REPRODUCE
1. Apply 150% of scaling (I'm using a 32" 4K monitor).
2. Run GNOME Clocks 45.0 with GTK 4.12.4 and the env `GDK_DEBUG=gl-fractional`.
3. Notice the blurriness of the entire app.

Using the same scaling:
1. Run Firefox 119.0.1.
2. Set the about:config flag `widget.wayland.fractional-scale.enabled` to true.
3. Restart Firefox.
4. Observe the blurriness and broken menus.

OBSERVED RESULT
Things blurry and broken. :(

EXPECTED RESULT
Thinks ultra crisp and sharp. :)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Parabola
(available in About System)
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
Comment 1 Iván Ávalos 2023-11-23 21:45:23 UTC
Created attachment 163410 [details]
GNOME Clocks with wp_fractional_scale_manager_v1
Comment 2 Iván Ávalos 2023-11-23 21:46:02 UTC
Created attachment 163411 [details]
GNOME Clocks without wp_fractional_scale_manager_v1
Comment 3 Iván Ávalos 2023-11-23 21:48:45 UTC
Created attachment 163412 [details]
Firefox without wp_fractional_scale_manager_v1
Comment 4 Iván Ávalos 2023-11-23 21:50:11 UTC
Created attachment 163413 [details]
Firefox with wp_fractional_scale_manager_v1
Comment 5 David Edmundson 2023-11-24 11:54:02 UTC
Do you know if you have similar issues with Qt6 apps?

Can you share your monitor resolution?
Comment 6 David Edmundson 2023-11-24 13:38:01 UTC
Ran gnome clocks with a scale of 1.25:

client window geometry = 61, 55, 870x690
buffer is: 1240x1015

in logical space:
buffer geometry is: 992x812
frame geometry is: 870x690
Comment 7 David Edmundson 2023-11-24 13:48:10 UTC
Do you know if there's a way to force the GTK apps to use server side decorations? 
I have a theory on what's up that it would be good to determine
Comment 8 David Edmundson 2023-11-24 16:11:28 UTC
I ran with  kwin's debug shader that shows when surfaces are stretched or not-pixel aligned.

Environment="KWIN_SCENE_VISUALIZE=fractional"

gnome-clocks had no traces, other than on the cursor. 
That strongly implies that any blurriness is a fault of GTK's rendering rather than kwin.  

I don't think this is actionable unless we see this app looking amazing in mutter/sway.
Comment 9 Iván Ávalos 2023-11-25 06:20:58 UTC
(In reply to David Edmundson from comment #5)
> Do you know if you have similar issues with Qt6 apps?

Qt6 apps don't look blurry by default, but they don't look super sharp either.

Do I need to enable some flag for them to use the protocol?

> Can you share your monitor resolution?

It's a standard 4K monitor: 3840x2160. I'm using it at 150% scale.

> Do you know if there's a way to force the GTK apps to use server side decorations? 
> I have a theory on what's up that it would be good to determine

I have no idea, to be honest. I looked it up and couldn't find anything.
Comment 10 David Edmundson 2023-11-28 10:01:46 UTC
>Qt6 apps don't look blurry by default, but they don't look super sharp either.

No, it should just work for anything 6.6 onwards
Comment 11 Iván Ávalos 2023-11-28 17:05:15 UTC
(In reply to David Edmundson from comment #10)
> No, it should just work for anything 6.6 onwards

Telegram is based on Qt6, and yet it renders at 200% (unlike in X11, where it correctly renders at 150%).
Comment 12 Iván Ávalos 2023-11-28 17:05:43 UTC
Created attachment 163583 [details]
Telegram rendering at 100% in Wayland
Comment 13 David Edmundson 2023-11-28 17:52:38 UTC
Telegram does their own thing. It's not a good test of the stock toolkit capabilities
Comment 14 Bug Janitor Service 2023-12-13 03:45:57 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 15 Bug Janitor Service 2023-12-28 03:46:24 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!