Bug 463024 - Plasma components don't respect Sub-pixel rendering
Summary: Plasma components don't respect Sub-pixel rendering
Status: CONFIRMED
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: components (show other bugs)
Version: 5.101.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-13 22:34 UTC by Nick Stefanov
Modified: 2023-12-08 18:05 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
RGB Clock (8.60 KB, image/png)
2022-12-16 14:03 UTC, mozo
Details
Only the UI elements highlighted in red are respecting my setting "Sub-pixel rendering: None" (248.30 KB, image/png)
2023-01-17 16:08 UTC, wazhai
Details
Disks & Devices problem (58.19 KB, image/png)
2023-01-18 16:54 UTC, mozo
Details
Font setting's hinting preview render under different hinting settings are the same (19.11 KB, image/png)
2023-02-16 17:21 UTC, Lee
Details
krunner-forced-subpixel-rendering.png (29.29 KB, image/png)
2023-02-27 22:48 UTC, phd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Stefanov 2022-12-13 22:34:31 UTC
SUMMARY
Plasma doesn't respect Sub-pixel rendering for system tray and desktop. I want Sub-pixel rendering turned off everywhere. It was always turned off till Frameworks 5.101.0 or Plasma 5.26.4, I'm not shure. Now in the settings Sub-pixel rendering is turned off but in system tray. My calendar, clock, keyboard layout, network applet, etc icons and menus are all with Sub-pixel rendering tuned on. It can be disabled only if I remove an aplet and add it again until the system restarts and then it's turned on again. 

Icons, files and shortcuts on the desktop are all with Sub-pixel rendering turned as well. If I create a new file or folder on the desktop, it's with Sub-pixel rendering turned off and I can put it side by side with others files which are with RGB on so I can have files with Sub-pixel rendering turned off and on at the same time and in the same place. 
Sub-pixel rendering works as expected everywhere inside KDE / QT applications.



STEPS TO REPRODUCE
1. Start plasma
2. 
3. 

OBSERVED RESULT
Plasma doesn't respect Sub-pixel rendering for system tray and desktop files, folders and shortcuts.

EXPECTED RESULT
Plasma should respect Sub-pixel rendering for system tray and desktop files, folders and shortcuts.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Comment 1 mozo 2022-12-15 09:16:44 UTC
Now I upgraded a second PC and the problem is there as well so everyone shoud have the same problem.
Comment 2 mozo 2022-12-16 09:06:47 UTC
Just realized the task switcher's list is affected as well.
Comment 3 mozo 2022-12-16 13:59:40 UTC
Here's a task switcher screenshot. See the text:
https://i.imgur.com/sNXg9kv.png
You can also see the clock and the keyboard layout.
Comment 4 mozo 2022-12-16 14:01:04 UTC
I'm sorry, on this screenshot the keyboard layout is fine but the cock it isn't. You can zoom in and see the RGB pixels.
Comment 5 mozo 2022-12-16 14:03:35 UTC
Created attachment 154627 [details]
RGB Clock

Zoomed image of the clock. RGB is clearly visible and it should be turned off.
Comment 6 Pesho 2022-12-19 18:01:39 UTC
The same issue occurs for me:

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Comment 7 EP 2022-12-20 18:14:33 UTC
Not only the subpixel rendering is force enabled but the hinting settings are ignored as well (no hinting applied). And not only the tray is affected but also the Task Manager, KRunner, Application Menu, Task Switcher, Digital Clock and probably some more widgets as well.
Comment 8 mozo 2022-12-20 18:41:49 UTC
I didn't notice KRunner, thank you. However, I'm using the legacy start menu and it's ok.
Comment 9 mozo 2022-12-24 12:20:28 UTC
One more finding:
If I issue kquitapp5 plasmashell && kstart5 plasmashell, the opened apps in the panel are with RGB sub-pixel rendering turned on. Only a restart fixes it.
Comment 10 mozo 2023-01-04 09:34:24 UTC
Plasma 5.26.5 - the problem is still here. Even tweaking /etc/fonts/local.conf doesn't help.
Comment 11 Nate Graham 2023-01-09 19:39:53 UTC
Nothing should have changed in Plasma recently, so it's highly likely to have been a regression caused by Qt or fontconfig.

What distro are you affected folks using, and what version of the fontconfig package do you have?

And can you all paste the output of running `grep Xft ~/.config/kdeglobals` in a terminal window?

Thanks!
Comment 12 Nate Graham 2023-01-09 19:43:06 UTC
Another option is that the issue was caused by https://invent.kde.org/frameworks/plasma-framework/-/commit/4d5ff1dc5171af5815f4b8d7f258cad1f9425240, which removed a workaround for an issue that was fixed in Qt.

By doing that, now everyone is getting their text rendered Text.NativeRendering in Qt, as opposed to sometimes using Text.QtRendering for fractional scale factors. So maybe Text.NativeRendering doesn't respect this setting like it should and this exposed a pre-existing Qt bug for users of fractional scale factors.

Are all of you using a scale factor other than 100%, 200% or 300%?
Comment 13 EP 2023-01-09 20:02:36 UTC
(In reply to Nate Graham from comment #12)
```
$ grep Xft ~/.config/kdeglobals
XftAntialias=true
XftHintStyle=hintslight
XftSubPixel=none
```
Global scale factor: 100%
Comment 14 EP 2023-01-09 20:26:19 UTC
(In reply to Felis from comment #13)
> (In reply to Nate Graham from comment #12)

Distro: Manjaro, fontconfig 2.14.1.
I don't remember what if anything has changed in the past month but now the issue persists only in some places, namely KRunner's input field and Task Switcher's window list (I use Compact) and it disappears after some time in the latter.
Comment 15 mozo 2023-01-09 21:56:15 UTC
(In reply to Nate Graham from comment #11)
> Nothing should have changed in Plasma recently, so it's highly likely to
> have been a regression caused by Qt or fontconfig.
> 
> What distro are you affected folks using, and what version of the fontconfig
> package do you have?
> 
> And can you all paste the output of running `grep Xft ~/.config/kdeglobals`
> in a terminal window?
> 
> Thanks!

grep Xft ~/.config/kdeglobals
XftAntialias=true
XftHintStyle=hintmedium
XftSubPixel=none

Arch Linux, fontconfig 2.14.1-2.
I don't use any other global scale factor than 100%.
Comment 16 mozo 2023-01-09 22:05:32 UTC
(In reply to Nate Graham from comment #11)
> what version of the fontconfig
> package do you have?

Downgrading to a lower fontconfig version doesn't help at all.
Comment 17 Nate Graham 2023-01-10 21:52:36 UTC
Ok, so if none of you are using fractional scaling, it's probably not an issue caused by https://invent.kde.org/frameworks/plasma-framework/-/commit/4d5ff1dc5171af5815f4b8d7f258cad1f9425240. Could be a Qt issue or a fontconfig issue. What fontconfig version did you downgrade to? If it's the fontconfig issue I'm thinking of, you might need to go to 2.14.0 or earlier.
Comment 18 mozo 2023-01-10 22:49:10 UTC
Yes, I don't use fractional scaling at all.
I downgraded to fontconfig 2.13.96 and there's no change.
Comment 19 Nate Graham 2023-01-11 16:20:21 UTC
Okay so it's not fontconfig, and it's not https://invent.kde.org/frameworks/plasma-framework/-/commit/4d5ff1dc5171af5815f4b8d7f258cad1f9425240.

It could be some other issue we caused (but how?) or a Qt bug that was introduced with an update. Did any of you also get distro updates for your Qt packages around when this started happening?
Comment 20 mozo 2023-01-11 16:51:19 UTC
I really don't remember, sorry :(
Comment 21 wazhai 2023-01-17 16:08:32 UTC
Created attachment 155382 [details]
Only the UI elements highlighted in red are respecting my setting "Sub-pixel rendering: None"

For me it's not just the Plasma shell, but rather most UI elements within Firefox and KDE apps keep using subpixel rendering.

I'm on a freshly installed and fully updated Kubuntu 22.04. 

I originally posted about this issue here and have attached more screenshots there showing the issue:
https://www.reddit.com/r/kde/comments/10du9dd/cant_fully_disable_subpixel_font_rendering/

I can try my unupdated Kubuntu 22.04.1 ISO and will comment again in case it works there as expected.
Comment 22 Jan Rathmann 2023-01-17 17:19:25 UTC
I did two tests by booting the live images of current Neon user  and Kubuntu 22.10.

- Neon live-image: (Plasma 5.26.5, Frameworks 5.101, Qt 5.15.8)

Can reproduce the bug.
By default, sub-pixel rendering is turned off in the font settings. But nevertheless I can see in a screenshot that sub-pixel rendering is used in the text of the clock applet in the systray!
For text in Kickoff and KDE apps (tested Systemsettings, Dophin, Window decoration), everything seems to be correct (no sub-pixel rendering).
However, Firefox (GTK) uses sub-pixel rendering in its UI texts!

- Kubuntu 22.10: (Plasma 5.25.5, Frameworks 5.98, Qt 5.15.6)

Bug in the Plasma panel is not there.
By default, sub-pixel rendering is turned on. If I turn it off in the font settings (and restart Plasma session), even the clock applet text is correctly rendered without sub-pixel rendering.
For anything else, results are the same as within Neon: KDE apps correct, Firefox (GTK) "wrong".
Comment 23 wazhai 2023-01-17 20:04:24 UTC
Using the unupdated Kubuntu 22.04.1 live iso didn't change things, but I made a bizarre discovery.

Even with the default setting to enable RGB subpixel rendering, the UI elements of System Settings from the attachment I uploaded are still rendered with grayscale on my machine. So it seems the setting is entirely ineffectual on Kubuntu 22.04 (without any backports repo)
Comment 24 mozo 2023-01-17 20:28:55 UTC Comment hidden (spam)
Comment 25 mozo 2023-01-18 16:54:18 UTC
Created attachment 155410 [details]
Disks & Devices problem

Here's more info about additional problem area. As you can see, sub-pixel rendering is turned off everywhere in the widget but for "Disk & Device in the upper left corner it isn't.
Comment 26 mozo 2023-01-26 12:14:37 UTC Comment hidden (spam)
Comment 27 mozo 2023-02-16 16:27:42 UTC Comment hidden (spam)
Comment 28 Lee 2023-02-16 17:21:32 UTC
Created attachment 156315 [details]
Font setting's hinting preview render under different hinting settings are the same

Not sure if this is related, but hinting is also not respected. No matter which level you choose, it stays at "slight".

A quick way to check: see the hinting preview in the font setting, it's all the same for all hinting levels.
Comment 29 Fushan Wen 2023-02-16 17:37:27 UTC
Don't know why I was CCed, but I don't really have any idea.
Comment 30 mozo 2023-02-22 11:42:03 UTC Comment hidden (spam)
Comment 31 phd 2023-02-27 22:48:41 UTC Comment hidden (spam)
Comment 32 mozo 2023-03-03 00:31:10 UTC Comment hidden (spam)
Comment 33 mozo 2023-03-20 09:35:16 UTC Comment hidden (spam)
Comment 34 Nate Graham 2023-03-20 09:38:51 UTC Comment hidden (spam)
Comment 35 mozo 2023-06-23 11:54:23 UTC Comment hidden (spam)
Comment 36 mozo 2023-11-07 12:27:57 UTC Comment hidden (spam)
Comment 37 phd 2023-11-07 17:21:46 UTC Comment hidden (spam)
Comment 38 mozo 2023-11-07 17:33:08 UTC Comment hidden (spam)
Comment 39 ratijas 2023-12-08 17:30:08 UTC
Interestingly, on Plasma 6 beta 1 I have a somewhat inverse problem. Mostly subpixel rendering is OFF as it should, but *some* software like tastenbrett (the on-screen keyboard visualization written in QML) have subpixel rendering ON.

Operating System: Arch Linux 
KDE Plasma Version: 5.90.90
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Kernel Version: 6.6.3-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 970M/PCIe/SSE2
Comment 40 mozo 2023-12-08 18:05:52 UTC
There was hopes it will be fixed in Plasma 6...