Bug 433115 - Global Scaling Options Seems to "lower" resolution unlike old "force font DPI"; consider re-adding it as an option
Summary: Global Scaling Options Seems to "lower" resolution unlike old "force font DPI...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_fonts (show other bugs)
Version: 5.21.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-02-17 20:52 UTC by Dimitris Giannos
Modified: 2021-03-07 00:32 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21.3
Sentry Crash Report:


Attachments
200% Scaling (1.50 MB, image/png)
2021-02-18 10:29 UTC, Dimitris Giannos
Details
150% Scaling (874.96 KB, image/png)
2021-02-18 10:35 UTC, Dimitris Giannos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitris Giannos 2021-02-17 20:52:30 UTC
Prior to 5.21 we had "Force font DPI" option. This option, at least on my 4K screen, would work like Global Scaling with the only difference being that global scaling option seems to "lower resolution" or... Try to "make pixels bigger" (Sorry I don't know what definitions should be used).

 I don't know if this behaviour was a bug unique to my system or not. 


How to confirm:
1. Use a 4K screen (or simply a high resolution one) and a system with Plasma <5.21
2. Try setting global scaling to 150-200% and also try setting "Force don't DPI" option ~120

Do you feel any difference?



Arch Linux, plasma 5.20-5.21
Comment 1 Nate Graham 2021-02-17 21:02:32 UTC
So there are a few things here:

1. Yeah, we removed the Force Fonts DPI setting from the fonts KCM on the logic that it was redundant with simply being able to change the fonts. Maybe that was a bad idea.

2. Because Wayland only does integer scaling, setting 150% scale will internally do 200% scale and then scale down the resulting image, which does cause some blurriness

3. 200% scale does not result in any downscaling at all, so it should be nice and sharp--exactly as when using the old Force Font DPI setting


Can you confirm that 200% scale produces an image that's as sharp as using the old force fonts DPI setting did? It should, and it does for me; if it doesn't for you, that's a bug that needs to be investigated.

I suspect that this will ultimately lead to multiple bug reports, but let's start with one thing at a time. :)
Comment 2 Dimitris Giannos 2021-02-17 21:06:39 UTC
I will try to answer all those. But I cannot guarantee when that happens. (Not because I'm lazy)
Comment 3 Nate Graham 2021-02-17 21:07:29 UTC
No worries. :)
Comment 4 Dimitris Giannos 2021-02-18 10:29:27 UTC
Created attachment 135829 [details]
200% Scaling

 Here is the image with Global Scaling set to 200%. It seems like it has affected only apps other than those of KDE (Dolphin, Konsole etc). If you zoom on this image you might see that everything looks kind of blurry inside firefox.
Comment 5 Dimitris Giannos 2021-02-18 10:35:25 UTC
Created attachment 135830 [details]
150% Scaling

 And here is with 150%. I think that they all downgrade. Here it seems like it downgrades less. You can see the panel though stays "clean".

 I also checked the monitor: it's an LG 32UK550/UL 500 model
                             3840x2160/60Hz
              Physical Size: ~39x69 cm (screen only)
Comment 6 Dimitris Giannos 2021-02-18 10:56:22 UTC
 I also opened inkscape. Seems like everything has been scaled without loss of quality. Also notice from the screenshots that plasma's mouse has been affected badly.
Comment 7 Nate Graham 2021-02-18 14:49:09 UTC
Blurriness at 200% scale in Firefox on Wayland is due to Firefox not using Wayland natively, but rather XWayland. XWayland apps suffer from this, sadly (known bug). If you run with `MOZ_ENABLE_WAYLAND=1` and restart Firefox, does it get better?
Comment 8 Dimitris Giannos 2021-02-18 17:52:40 UTC
Where am I supposed to write this line? I typed it in terminal and seems like, after restarting, nothing changed.
Comment 9 Nate Graham 2021-02-19 15:30:53 UTC
You can do this:

`MOZ_ENABLE_WAYLAND=1 firefox`
Comment 10 Dimitris Giannos 2021-02-19 17:12:57 UTC
 The command seemed to make Firefox look neater, probably as it should be in this screen, but it seems like there were a lot of screen tearings (or some similar bugs) and plasma couldn't handle it, so it seems like I was logged into a new session automatically and a report said that konsole crashed.
Comment 11 Nate Graham 2021-02-19 19:26:56 UTC
Yeah, so what's going on there is that Firefox looks correct when using Wayland native mode. When in XWayland mode, it's downscaled due to the aforementioned problem with scaling on XWayland.

So maybe we really do need to bring back the force Font DPI spinbox until Wayland gains non-integer scaling without downscaling, and XWayland gains the ability to do any kind of scaling without upscaling. :(
Comment 12 Gianluca Pettinello 2021-02-19 20:22:09 UTC
(In reply to Nate Graham from comment #1)
> So there are a few things here:
> 
> 1. Yeah, we removed the Force Fonts DPI setting from the fonts KCM on the
> logic that it was redundant with simply being able to change the fonts.
> Maybe that was a bad idea.
> 
> 2. Because Wayland only does integer scaling, setting 150% scale will
> internally do 200% scale and then scale down the resulting image, which does
> cause some blurriness
> 
> 3. 200% scale does not result in any downscaling at all, so it should be
> nice and sharp--exactly as when using the old Force Font DPI setting
> 
> 
> Can you confirm that 200% scale produces an image that's as sharp as using
> the old force fonts DPI setting did? It should, and it does for me; if it
> doesn't for you, that's a bug that needs to be investigated.
> 
> I suspect that this will ultimately lead to multiple bug reports, but let's
> start with one thing at a time. :)

Yes please restore Force Fonts DPI! Please...Please...Please
Comment 13 Nate Graham 2021-02-23 17:23:26 UTC
So basically you want to work around 433269.
Comment 14 Dimitris Giannos 2021-02-23 18:31:20 UTC
If that's more convenient for everyone.. then yes.
Comment 15 Tom B 2021-02-24 12:37:36 UTC
I came here to make this exact same bug. 

The problem is when dealing with applications that actually use pixel based images I lose definition.

If I set my scale to 175% on a 4k monitor, then watch a 4k movie in MPV, it gets scaled down and I lose definition.

If I open a 4k image in a web browser or image editing tool the image is scaled down to the "Global Scale" and I cannot see the full image.

Some applications (GIMP) for example, have very blurry fonts.

The old DPI approach worked very well. Using the "Scale" option, other that a few desktop UI elements that understand it, I may as well run my screen at 1080p.

The font DPI approach worked a lot better because one pixel was always one pixel.
Comment 16 Tom B 2021-02-24 12:51:51 UTC
Sorry for the double post but here's a way to test it and demonstrate the issue

1. Take a screenshot using spectacle or another tool at native resolution and save it lossless (png)

2. Turn on display scaling 

3. Open the screenshot in mpv:

mpv screenshot-001.png --pause

Double click to full screen it and you can see that it's not as sharp as the original. You can also press `i` to bring up the stats and confirm that "Window scale" is not 1.0.

This could probably be fixed by MPV (and every other application affected...) but the previous DPI approach worked fine without needing to fix everything that uses images.
Comment 17 Bug Janitor Service 2021-02-24 14:46:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/669
Comment 18 soredake 2021-02-28 20:04:42 UTC
Why KDE/Wayland cannot have scaling without lowering resolution like in KDE/X11? Scaling on X11 is mostly works and similar to windows.
Comment 20 Nate Graham 2021-03-07 00:32:01 UTC
Git commit 62842ac6fd5571394e38360b345a7ad3a1187273 by Nate Graham.
Committed on 07/03/2021 at 00:30.
Pushed by ngraham into branch 'master'.

Re-add Force Font DPI spinbox on Wayland

People are using this feature to work around Wayland's terrible
fractional scaling implementation that makes everything super blurry. I
can't in good conscience tell them to use it anyway because it really
does look so bad. :( See https://bugs.kde.org/show_bug.cgi?id=433269.

This reverts commit 65defddee95db6738d5e2c80f6c7b373fde451a1
This reverts commit 40afa58ab9bf0d0808edb891f9cd855316a82411
FIXED-IN: 5.21.2

M  +3    -2    kcms/fonts/fonts.cpp
M  +1    -0    kcms/fonts/fontsaasettings.cpp
M  +4    -0    kcms/fonts/fontsaasettingsbase.kcfg
M  +14   -3    kcms/fonts/package/contents/ui/main.qml
M  +6    -1    kcms/krdb/krdb.cpp
M  +8    -0    startkde/startplasma-wayland.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/62842ac6fd5571394e38360b345a7ad3a1187273
Comment 21 Nate Graham 2021-03-07 00:32:28 UTC
Git commit 1278ebee2a6e72de2b3600d2baa61e57378f3d9f by Nate Graham.
Committed on 07/03/2021 at 00:32.
Pushed by ngraham into branch 'Plasma/5.21'.

Re-add Force Font DPI spinbox on Wayland

People are using this feature to work around Wayland's terrible
fractional scaling implementation that makes everything super blurry. I
can't in good conscience tell them to use it anyway because it really
does look so bad. :( See https://bugs.kde.org/show_bug.cgi?id=433269.

This reverts commit 65defddee95db6738d5e2c80f6c7b373fde451a1
This reverts commit 40afa58ab9bf0d0808edb891f9cd855316a82411
FIXED-IN: 5.21.2


(cherry picked from commit 62842ac6fd5571394e38360b345a7ad3a1187273)

M  +3    -2    kcms/fonts/fonts.cpp
M  +1    -0    kcms/fonts/fontsaasettings.cpp
M  +4    -0    kcms/fonts/fontsaasettingsbase.kcfg
M  +14   -3    kcms/fonts/package/contents/ui/main.qml
M  +6    -1    kcms/krdb/krdb.cpp
M  +8    -0    startkde/startplasma-wayland.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/1278ebee2a6e72de2b3600d2baa61e57378f3d9f