Bug 449212 - Late re-scale on login causes various issues (blurry text in Qt apps/widgets; widgets get moved around, wallpaper zoomed in)
Summary: Late re-scale on login causes various issues (blurry text in Qt apps/widgets;...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Startup process (show other bugs)
Version: 5.23.90
Platform: Compiled Sources Linux
: HI normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression, wayland
: 447732 451083 451234 452931 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-01-26 18:34 UTC by Viorel-Cătălin Răpițeanu
Modified: 2022-07-06 15:20 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25.2


Attachments
Shell you got after Login in (check the Clock/Activities applet). (3.87 MB, image/png)
2022-01-26 18:34 UTC, Viorel-Cătălin Răpițeanu
Details
Shell you got after restarting the plasma (check the Clock/Activities applet). (3.88 MB, image/png)
2022-01-26 18:35 UTC, Viorel-Cătălin Răpițeanu
Details
Wrongly-alligned quote (1.55 MB, image/png)
2022-02-08 11:24 UTC, Lyubomir
Details
Wrongly-alligned notifications (208.87 KB, image/png)
2022-02-08 11:26 UTC, Lyubomir
Details
Wrongly-alligned settings upon opening (250.72 KB, image/png)
2022-02-08 11:27 UTC, Lyubomir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Viorel-Cătălin Răpițeanu 2022-01-26 18:34:41 UTC
Created attachment 145969 [details]
Shell you got after Login in (check the Clock/Activities applet).

SUMMARY
On a 4k monitor with scale set to 200%, the first shell you get after you log has blurry text (dpi issues) for a number of Qt apps and widgets

STEPS TO REPRODUCE
1. Have a 4K monitor scaled to 200% (Nvidia proprietary driver).
2. Do a fresh login into a Wayland plasma session.

OBSERVED RESULT
A number of Qt apps and widgets (like the Digital clock text applet and the Activities applet) have blurry text (see screenshot attached. Restarting the plasma shell seems to fix this issue (screenshot attached).

EXPECTED RESULT
The dpi scaling for text should work on the shell you got after login in.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Plasma master (Wayland session)
KDE Plasma Version: 5.23.90 master
KDE Frameworks Version: 5.91 master
Qt Version: 5.15.2
Video Driver: nvidia 495.46, egl-wayland 2:1.1.9
Comment 1 Viorel-Cătălin Răpițeanu 2022-01-26 18:35:21 UTC
Created attachment 145971 [details]
Shell you got after restarting the plasma (check the Clock/Activities applet).

kquitapp5 plasmashell && kstart5 plasmashell
Comment 2 Nate Graham 2022-01-26 18:37:06 UTC
Can reproduce. For me, this started happening with 100% reproducibility after d53fd656e8e91835fbb4b5e37e32bb32dfd6e445 in plasma workspace.

Seems related to Bug 433416.
Comment 3 Nate Graham 2022-01-26 18:45:39 UTC
This is not a duplicate of Bug 433416 since that concerns a Qt issue that happens when the scale is changed.

In this bug, the scale is not changed; it was already set to some value in the KCM. If we're triggering the same Qt issue brought up in Bug 433416 because the implementation causes the scale to change during login, that's something we should fix independently of the Qt bug. There's no reason for the scale to change on login when it's already been set.
Comment 4 Lyubomir 2022-01-26 21:58:51 UTC
FWIW I also experience this blurriness on login with the whole taskbar, not only the clock.
Comment 5 Lyubomir 2022-01-27 09:54:34 UTC
@Nate I'm pretty sure this bug and https://bugs.kde.org/show_bug.cgi?id=447732 are related.
Comment 6 Nate Graham 2022-01-27 15:25:34 UTC
Good catch, you're right.
Comment 7 Nate Graham 2022-01-27 15:27:58 UTC
So it seems like the re-scale on login triggers https://bugreports.qt.io/browse/QTBUG-78327, which is the cause of the blurriness.

That Qt bug should certainly be fixed, but the re-scale on login is the wrong thing to do anyway, especially if it also causes the issue you're seeing in 447732, which would not be fixed by fixing that Qt bug.
Comment 8 Nate Graham 2022-01-27 15:28:16 UTC
*** Bug 447732 has been marked as a duplicate of this bug. ***
Comment 9 Vlad Zahorodnii 2022-01-28 11:33:45 UTC
> That Qt bug should certainly be fixed, but the re-scale on login is the wrong thing to do anyway, especially if it also causes the issue you're seeing in 447732, which would not be fixed by fixing that Qt bug.

from what I can tell, the nvidia driver doesn't expose the edid, so kwin reads wrong output configuration (or doesn't apply any at all). there's nothing that we can do.

can you report this issue(the nvidia driver not exposing EDID) to nvidia developers?
Comment 10 Nate Graham 2022-01-28 14:14:09 UTC
This is not NVIDIA-specific. I and several others affected have Intel iGPUs and no NVIDIA hardware.
Comment 11 Nate Graham 2022-02-01 15:29:45 UTC
*** Bug 449321 has been marked as a duplicate of this bug. ***
Comment 12 Fabian Vogt 2022-02-01 21:28:15 UTC
I was able to reproduce bug 449321, which might be related.

The KCM saves changes to ~/.local/share/kscreen/control/configs/<hash of outputs>, which are at some point read by the KDED module, applied and the resulting config saved to ~/.local/share/kscreen/<hash of outputs>. On startup, kwin_wayland reads the latter, if it exists.

This is an issue if first a configuration in the wayland session is created with e.g. 125% scale, but later on an X11 session started again. Once the KDED module notices a change (manual or automatic, but not sure about the latter), it immediately overwrites the ~/.local/share/kscreen/<hash of outputs> file created in the wayland session, but with "scale": 1 because the xrandr backend does not support per-output scaling. The result is that on the next start of kwin_wayland, a 100% scale is applied initially.

If rm -r ~/.local/share/kscreen and recreating the config in the wayland session helps, then this is probably the same as bug 449321. If not, this bug is most likely a different issue. Unfortunately there's no logging of what kwin_wayland does on startup.

> Can reproduce. For me, this started happening with 100% reproducibility after d53fd656e8e91835fbb4b5e37e32bb32dfd6e445 in plasma workspace.

That should not influence Wayland applications, but I guess it changed the startup sequence just enough for a race condition to have a different outcome.
Comment 13 Nate Graham 2022-02-01 21:33:48 UTC
Yes, that makes sense.
Comment 14 Vlad Zahorodnii 2022-02-02 12:47:57 UTC
(In reply to Nate Graham from comment #10)
> This is not NVIDIA-specific. I and several others affected have Intel iGPUs
> and no NVIDIA hardware.

qt handles changing scale poorly, I don't see what we can do in kwin to fix the blurriness. with nvidia it's easier to reproduce because kwin can't load the right output config at startup, so it sticks with a scale factor of 1
Comment 15 Nate Graham 2022-02-02 18:14:45 UTC
> I don't see what we can do in kwin to fix the blurriness.
We could not unnecessarily change scale on login, or if we have to, we would do it much earlier in the login process so that the scale is already set correctly by the time GUI software launches. I guess that would be a Plasma thing, so I'll move this back there.
Comment 16 Nate Graham 2022-02-02 18:15:42 UTC
For me, all of this started happening after https://invent.kde.org/plasma/plasma-workspace/-/commit/d53fd656e8e91835fbb4b5e37e32bb32dfd6e445 was committed.
Comment 17 Lyubomir 2022-02-08 11:24:56 UTC
Created attachment 146428 [details]
Wrongly-alligned quote

FWIW this probably causes at least as much harm as it fixes:
1. Breaks desktop wallpaper - variety's quotes are "right-alligned", even some of them go out of the right corner and not all of them can be seen.
Comment 18 Lyubomir 2022-02-08 11:26:31 UTC
Created attachment 146430 [details]
Wrongly-alligned notifications

2. Wrongly-alligned notifications
Comment 19 Lyubomir 2022-02-08 11:27:18 UTC
Created attachment 146431 [details]
Wrongly-alligned settings upon opening

3. Wrongly-alligned settings upon opening
Comment 20 Lyubomir 2022-02-09 10:29:07 UTC
(In reply to Lyubomir from comment #19)
> Created attachment 146431 [details]
> Wrongly-alligned settings upon opening
> 
> 3. Wrongly-alligned settings upon opening

I have to say that Plasma 5.24 fixes the location of the windows and i'm very impressed by the new **smoothness**. Rocks!
Comment 21 simon 2022-02-14 09:38:56 UTC
I don't know if this is related but global scale on Wayland in Plasma 5.24 is broken for me.

This is when using 4k screen with 200% scaling and amdgpu.

Behaviour: after restart desktop session is displayed in 100% even though global scale is still set to 200%.
Comment 22 Nate Graham 2022-03-22 01:47:40 UTC
*** Bug 451083 has been marked as a duplicate of this bug. ***
Comment 23 Nate Graham 2022-03-22 15:36:02 UTC
*** Bug 451234 has been marked as a duplicate of this bug. ***
Comment 24 Nate Graham 2022-03-22 15:49:54 UTC
*** Bug 451259 has been marked as a duplicate of this bug. ***
Comment 25 Nate Graham 2022-04-25 17:53:44 UTC
*** Bug 452931 has been marked as a duplicate of this bug. ***
Comment 26 Lyubomir 2022-06-15 18:35:46 UTC
On my laptop i think this doesn't happen anymore. Even the splash screen is not blurry. It seems that it re-scales right before the Splash Screen appears... Have you fixed this?
Comment 27 kde.org 2022-06-28 11:44:13 UTC
(In reply to Nate Graham from comment #2)
> Can reproduce. For me, this started happening with 100% reproducibility
> after d53fd656e8e91835fbb4b5e37e32bb32dfd6e445 in plasma workspace.
> 
> Seems related to Bug 433416.

Hi Nate,

@Lyubomir reports the issue fixed for him/her. Can you confirm (or deny :-) that it's fixed for you as well?
Comment 28 Nate Graham 2022-06-28 15:49:56 UTC
It's fixed for me too with current git master. I would suspect it got fixed with the fix for a systemd boot race condition recently, which made it into Plasma 5.25.2.
Comment 29 Lyubomir 2022-06-28 18:58:27 UTC
I'm still on 5.25.1 LOL... the real programmer question: "But why does it work now???" /s
Comment 30 Nate Graham 2022-06-28 19:38:32 UTC
It might have been fixed in 5.25.1; I can't 100% remember right now
Comment 31 indecisiveautomator 2022-07-05 20:54:40 UTC
This bug as described in Bug 451259 is still present for me on Plasma 5.25.2
Comment 32 Nate Graham 2022-07-06 15:20:58 UTC
Hmm, then that must be a separate issue. I can't reproduce it FWIW.