Bug 482336 - Blurry UI when using fractional scaling
Summary: Blurry UI when using fractional scaling
Status: RESOLVED INTENTIONAL
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.0.0
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-03 18:32 UTC by popov895
Modified: 2024-03-06 17:39 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Preview (424.46 KB, image/png)
2024-03-05 22:40 UTC, popov895
Details
Icons look blurry (686.26 KB, image/png)
2024-03-06 10:27 UTC, popov895
Details

Note You need to log in before you can comment on or make changes to this bug.
Description popov895 2024-03-03 18:32:14 UTC
SUMMARY

Unfortunately, the UI still looks blurry when using fractional scaling in Plasma 6 (125% in my case). For some reason, all other reports about this issue are closed, but in fact the issue still exists. The problem exists both on Wayland and X11.

SOFTWARE/OS VERSIONS

Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
KDE Gear Version: 24.02.0
Qt Version: 6.6.2
Kernel Version: 6.5.0-21-generic (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 1 Nate Graham 2024-03-05 17:43:22 UTC
It's not very helpful to report blurriness without even a screenshot that shows the blurriness! Please attach a full-screen screenshot so we can see what you mean when you say blurriness.
Comment 2 popov895 2024-03-05 22:40:26 UTC
Created attachment 166451 [details]
Preview

Sorry, here's it.

As you can see from above in the attached image, the top and bottom borders of the selection frame have different sizes (it's not very noticeable, but still). But the really frustrating thing is the blurred font and icons (the main part of the attached image).

Maybe there's something wrong with Neon, because I haven't tested it in other distros.
Comment 3 Nate Graham 2024-03-05 22:49:51 UTC
Thanks for the annotated screenshot; it's helpful. 

Unfortunately improved Wayland fractional scaling support in Qt6 still cannot compensate for the fact that a 1.25px stroke can't be mapped onto a 1px pixel without either blurriness or clipping. There simply isn't a physical way to do this.

Using the Font DPI to work around that issue has the side effect of breaking the visual relationships between items, because many things don't get scaled at all. It can look *okay* at 125% scale where this effect is minimized, but the higher the scale, the more ridiculous the result looks. We had tons and tons and tons of bug reports about this. People failed to understand the implications of one approach vs the other one, and having multiple ways to scale the system confused people and we got even more odd bug reports about invalid setups.

Hence, we made the decision to remove the Font DPI setting on Wayland in Plasma 6, so I'm afraid a small amount of weirdness with very thin strokes has to be expected here.

That said, the text on screenshot of the Fonts page looks much worse than the text in other screenshots, which is unusual. The level of blurriness there is quite noticeable, and not expected. Can you still reproduce that after quitting System Settings and re-opening it? Is System Settings running under XWayland or something weird?
Comment 4 popov895 2024-03-06 10:25:49 UTC
> Unfortunately improved Wayland fractional scaling support in Qt6 still
> cannot compensate for the fact that a 1.25px stroke can't be mapped onto a
> 1px pixel without either blurriness or clipping. There simply isn't a
> physical way to do this.

That's understandable, but they should still look the same since they're the same size, right? Why not stop using those strokes and use a solid color instead?

> That said, the text on screenshot of the Fonts page looks much worse than
> the text in other screenshots, which is unusual. The level of blurriness
> there is quite noticeable, and not expected. Can you still reproduce that
> after quitting System Settings and re-opening it? Is System Settings running
> under XWayland or something weird?

The font always looks blurry when global scaling set to 125%, and it's not XWayland (checked with xwininfo and xlsclients). I also tried the following, but nothing helped:
- disabling anti-aliasing
- changing sub-pixel rendering
- changing hinting
- changing scaling method for legacy applications (X11)
- changing RGB range
- changing font face
- changing QT_AUTO_SCREEN_SCALE_FACTOR, QT_ENABLE_HIGHDPI_SCALING, QT_SCALE_FACTOR, QT_SCREEN_SCALE_FACTORS, QT_FONT_DPI

Below is the output of some commands, maybe it will be helpful.

> $ xdpyinfo | grep -B 2 resolution
> screen #0:
>   dimensions:    1920x1080 pixels (508x285 millimeters)
>   resolution:    96x96 dots per inch

> $ xrdb -query
> Xcursor.size:   30
> Xcursor.theme:  breeze_cursors
> Xft.antialias:  1
> Xft.dpi:        120
> Xft.hinting:    1
> Xft.hintstyle:  hintslight
> Xft.rgba:       rgb

> $ xrandr -q
> Screen 0: minimum 16 x 16, current 1920 x 1080, maximum 32767 x 32767
> eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
>    1920x1080     59.96*+
>    1440x1080     59.99
>    1400x1050     59.98
>    1280x1024     59.89
>    1280x960      59.94
>    1152x864      59.96
>    1024x768      59.92
>    800x600       59.86
>    640x480       59.38
>    320x240       59.52
>    1680x1050     59.95
>    1440x900      59.89
>    1280x800      59.81
>    1152x720      59.97
>    960x600       59.96
>    928x580       59.88
>    800x500       59.50
>    768x480       59.90
>    720x480       59.71
>    640x400       59.95
>    320x200       58.96
>    1600x900      59.95
>    1368x768      59.88
>    1280x720      59.86
>    1024x576      59.90
>    864x486       59.92
>    720x400       59.55
>    640x350       59.77
Comment 5 popov895 2024-03-06 10:27:35 UTC
Created attachment 166471 [details]
Icons look blurry

And keep in mind that icons also look blurry.
Comment 6 Nate Graham 2024-03-06 17:39:40 UTC
Again, some blurriness is unfortunately expected, especially for icons with 1px strokes. We've already made a number of improvements there, and I'm not sure there's anything else we can do at this point.

The Fonts KCM being blurrier than it needs to be seems like something we can fix, though. Can I ask you to open a new bug report for that specifically? Thanks!