Bug 478082 - Wayland screen config not sharing old scale factor
Summary: Wayland screen config not sharing old scale factor
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-04 21:25 UTC by Oded Arbel
Modified: 2024-01-01 22:47 UTC (History)
4 users (show)

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


Attachments
X11 Plasma 6 session (223.98 KB, image/png)
2023-12-04 21:26 UTC, Oded Arbel
Details
Wayland Plasma 6 session (311.39 KB, image/png)
2023-12-04 21:26 UTC, Oded Arbel
Details
I tried with a new user account I just created, and the its the same issue (2.33 MB, image/png)
2023-12-04 22:38 UTC, Oded Arbel
Details
This is how it is currently on my Plasma 5 wayland system (1.51 MB, image/png)
2023-12-05 08:19 UTC, Oded Arbel
Details
Plasma 6 display configuration on Wayland and X11 (2.21 MB, image/png)
2023-12-09 12:43 UTC, Oded Arbel
Details
correct screenshot of display configuration on Plasma 6 Wayland and X11 (2.22 MB, image/png)
2023-12-09 12:46 UTC, Oded Arbel
Details
Plasma 6 on upgraded account (300.33 KB, image/png)
2023-12-10 00:16 UTC, Oded Arbel
Details
Kate vs gedit (294.70 KB, image/png)
2023-12-10 00:30 UTC, Oded Arbel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2023-12-04 21:25:37 UTC
SUMMARY

After installing Plasma 6 beta 1 using Neon Unstable edition, and reusing my home folder from a previous 5.27 installation (where I was running on Wayland), when logging in to Wayland the DPI of Plasma elements in really low. On an X11 session is looks OK - without changing anything other than logging out and logging back with another session.

GTK applications have correct DPI. 

See screenshots.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.0
Kernel Version: 6.2.0-37-generic (64-bit)
Graphics Platform: offscreen
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Comment 1 Oded Arbel 2023-12-04 21:26:15 UTC
Created attachment 163872 [details]
X11 Plasma 6 session
Comment 2 Oded Arbel 2023-12-04 21:26:40 UTC
Created attachment 163873 [details]
Wayland Plasma 6 session
Comment 3 Oded Arbel 2023-12-04 22:38:08 UTC
Created attachment 163879 [details]
I tried with a new user account I just created, and the its the same issue

No configuration changes, everything is default, but the Wayland rendering looks like its 120% scaled up, and also the fonts are rendered a bit weird.
Comment 4 Oded Arbel 2023-12-05 08:19:16 UTC
Created attachment 163894 [details]
This is how it is currently on my Plasma 5 wayland system

This is the size I expect things to be.
Comment 5 Oded Arbel 2023-12-06 09:32:16 UTC
I tried living with this issue for a bit, but I can't - it makes my (frankly very much good enough) 1920x1200 screen feel cramped and small - so I went back to Plasma 5 (on Wayland). I've previously seen this effect when  trying to install Plasma 6 from Neon Unstable repo - on top of an existing Kubuntu installation, but I thought it was because of the upgrade process messing something up.

This is a show stopper for me for Plasma 6 - which is a shame, as I want to be on the development chain and help catch bugs early, but I can't daily drive Plasma 6 with this very low DPI.

I'll try to repro this issue on a *really* clean install, but after using a new root (i.e. - not an upgrade of an existing installation) with a new home directory, I doubt a cleaner install will be different.
Comment 6 Marco Martin 2023-12-07 14:44:25 UTC
what does say the display systemsettings page? can you post a screenshot of that as well (on x11 and wayland)?
Comment 7 Oded Arbel 2023-12-09 12:43:17 UTC
Created attachment 164037 [details]
Plasma 6 display configuration on Wayland and X11

Here are the display configuration details on Wayland vs X11 - and this is indeed the issue: The Wayland default configuration is to have 125% scale, while the X11 default configuration is 100% scale.

Now that I know this is the problem, I can workaround it by manually setting the scale, but I still think this is wrong, and it is exactly the same problem that the MS-Windows default configuration has: it defaults to have 1920 pixels wide screens ("HD") to a default scale of 125% that makes the UI blurry and too large. In the Plasma 6 version of this bad configuration there are also font rendering issues (which should probably be fixed regardless) but it should still not set a default fractional scale factor.

I was going to say that the default configuration should be to not scale at all, but I guess it makes sense to have a 200% scale for UHD ("4K") screens.
Comment 8 Oded Arbel 2023-12-09 12:46:16 UTC
Created attachment 164038 [details]
correct screenshot of display configuration on Plasma 6 Wayland and X11

Apologies - this is the correct image I wanted to upload. Its the same two screenshots but shown in the correct order and without bad cropping
Comment 9 Oded Arbel 2023-12-09 13:12:46 UTC
Also, now that I thought of that a bit - why would the scaling change for an existing user configuration that was upgraded from Plasma 5 on Wayland to Plasma 6 on Wayland?

That seems very wrong to me - changing the new user defaults is one thing, but why would you want to change the setting for an existing user that was previously using Wayland at 100% scaling to 125% scaling just because they upgraded from Plasma 5 to Plasma 6? I can't think of a case where the user won't think its a bug.
Comment 10 Oded Arbel 2023-12-10 00:16:32 UTC
Created attachment 164057 [details]
Plasma 6 on upgraded account

And now I'm even more confused: Running on latest updated Neon unstable edition, the new user account I created clearly showed that Wayland looks scaled up because it defaults to a 125% scaling. Changing that fixes the problem on the new user account.

Thinking that I know this is the issue and the workaround, I logged back into my original user account (that is running fine on Plasma 5 Wayland), and on that account - Plasma 6 still looks scaled up (compare attachment #163872 [details] - from Plasma 5 - to attachment #163873 [details] - from Plasma 6), but the Display Configuration widget claims that it is using 100% scale (see this screenshot), and setting the scale to 125% indeed increases it even more.

So regarding my comment #9, it looks like that while the user settings from Plasma 5 have not actually been modified by running Plasma 6 (and I can boot back to my old Plasma 5 installation and everything works well there), it behaves as if the Plasma 6 default of 125% is in effect over the 100% scale that it claims to be set to.
Comment 11 Oded Arbel 2023-12-10 00:30:44 UTC
Created attachment 164058 [details]
Kate vs gedit

As I've mentioned previously, GTK apps look to have the correct DPI, in this screenshot we can see Kate and Gedit using the same font at the same point size with the same text, and while the Gedit font rendering is atrocious (and icons are missing, so something is clearly broken) - it is in the correct size, while the Kate text is clearly too large and is also blurry to boot.

Also notice how the window decoration is actually the correct size (compared to attachment #163894 [details] in a working Plasma 5 Wayland session) and like it is on the new account's X11 session while the new accounts Wayland session at the default "real" 125% scale has a larger window decoration (as expected) - so only the KDE application style and shell are at 125% fractional scaling.
Comment 12 Akseli Lahtinen 2023-12-11 14:39:46 UTC
When it comes to blurry font in GTK apps, have you installed xdg-desktop-portal-gtk ? For me that usually fixes it. (Unsure what the package is called in Neon)
Comment 13 David Edmundson 2023-12-11 14:40:28 UTC
I think we're mixing up 2 bugs. The fonts in GTK apps being messed up with a different scale factor and the fact that your user settings were lost.
Lets treat this bug as purely the former. 

There was a separation of wayland and X11 configuration files for Plasma 6. It seems like that is being lost and we are hitting the auto-generator.
Comment 14 Oded Arbel 2023-12-11 16:17:48 UTC
(In reply to David Edmundson from comment #13)
> I think we're mixing up 2 bugs. The fonts in GTK apps being messed up with a
> different scale factor and the fact that your user settings were lost.
> Lets treat this bug as purely the former. 

You mean - the later? I don't care about sucky fonts in GTK apps (though I'll check what Akseli Lahtinen said - it seems relevant as I have this package installed on my Neon stable install).

> There was a separation of wayland and X11 configuration files for Plasma 6.

This explains the behavior with a new user where the default scaling for X11 is 100% and for Wayland its 125%. I don't see how it is relevant to upgrading with an existing user account that was previously using Wayland with 100% scale - unless on upgrade the new configuration treats the old 100% as 125% but keeps showing 100% (applying a 1.25 factor in the backend without showing it). 

> It seems like that is being lost and we are hitting the auto-generator.

If on upgrade the new configuration is created a new, then I'd expect the Display Configuration to show a scale of 125% (as seen in attachment #164038 [details]) and not 100% (as seen in attachment #164057 [details]).

I think I can summarize the issue as:

Running Plasma 6 Wayland with a user account upgraded from Plasma 5 Wayland (that uses 100% scale), the Plasma style is scaled 125% even though Display Configuration shows 100% and window decorations are also shown correctly at 100% scale.

BTW - if the configuration was separated for Plasma 6, where can I find it? looking ~/.local/share/kscreen, everything is set to "scale": 1
Comment 15 Nate Graham 2023-12-13 17:39:35 UTC
If the issue is that now on Wayland the default scale factor is 125%, but it wasn't in X11 on Plasma 5, then I think this is actually intentional. On Wayland you're hitting the default screen scale factor generation code, which picks 125% for your exact screen and resolution. On X11 that code doesn't run because we can't ensure that any global scale we auto-generate would work for all screens you ever use.

To verify this, can you confirm that you went from a Plasma 5 X11 session to a Plasma 5 Wayland session? If so, then the behavior you're seeing is intentional.
Comment 16 Oded Arbel 2023-12-15 06:01:12 UTC
(In reply to Nate Graham from comment #15)
> To verify this, can you confirm that you went from a Plasma 5 X11 session to
> a Plasma 5 Wayland session?

No, this is not the case. As the summary says:

(In reply to Oded Arbel from comment #0)
> After installing Plasma 6 beta 1 using Neon Unstable edition, and reusing my
> home folder from a previous 5.27 installation (where I was running on
> Wayland)

To reiterate:

My current setup is Plasma 5.27.10 *Wayland* which works well. See attachment #163894 [details].

When I upgrade my running Plasma 5 Wayland user setup (with the Display Configuration set to scale 100%), to Plasma 6 Wayland, the Plasma application style looks like it is scaled 125% - it has the same size as a new user setup under Wayland (that has a default scale of 125%). See attachment #163873 [details].

# Real Problems (assuming the above is intended behavior):

1. Only the Plasma application style is scaled 125%. Windows decorations are not scaled, nor are non-KDE applications - the 125% scaling applies *only* to Plasma elements (shell and applications using the Plasma application style). Compare attachment #164057 [details] and attachment #164038 [details] - the window decorations in the first screenshot look like the X11 decorations from the second screenshot, while the application style looks like the Wayland style from the second screenshot.

2. The Display Configuration still shows the scale factor as "100%". I did not find a way to disable this scaling under Plasma 6 Wayland. See attachment #164057 [details].

3. If I try to set the Display Configuration scale factor to 125%, all the other elements are scaled to 125%, but the Plasma style is scaled even larger than that - so it is kept in sync. This makes the whole thing even less usable than it was unusable before.
Comment 17 Oded Arbel 2024-01-01 15:00:44 UTC
I've tries a few ways to see if I can reset the incorrect DPI/scaling for an upgrade:

1. removing "~/.config/k*" and "~/.config/*plasma*" - this did not solve the problem and the result looks like all the Plasma 6 screenshots with incorrect scaling that I've posted above, even though all the Plasma settings were reset (shortcuts and such).

2. removing all of "~/.local" and "~/.config" - this did solve the problem: after logging in the display configuration was completely reset and I can see that Plasma display configuration detect scaling of 125% for my 16:10 HD screen and 175% for my 16:9 UHD screens. After setting the scaling back to 100% it looks like I expect it to look. There still is a weird issue with the kickoff menu showing not in the correct location (which was present in the broken upgraded setup), but that may be another issue all together so I won't discuss it here anymore.

I've tried to compare the resulting configuration from both (1), (2) and my working Plasma 5 Wayland setup, and there's a lot of differences that are mostly color changes and stuff, but I can't find any smoking gun that talks about DPI and scaling. I did find it weird that in (2), after logging into Plasma 6 Wayland and setting up the screen, the "~/.local/share/kscreen" folder was not created and there's no kscren configuration files.

I also found some "kconf update script" called "plasma6.0-remove-dpi-settings" which is installed and supposedly run at some point (at least that's what "~/.config/kconf_updaterc" seems to be saying as far as I understand) - and that seemed relevant, but I couldn't find the source for this executable - so I don't know what it does and how relevant it may be.
Comment 18 Oded Arbel 2024-01-01 22:47:14 UTC
I found the problem, and it was my local configuration. I've marked this tickets as NOT A BUG, though that may or may not be correct, depending on what one may expect.

The problem was that I had a configuration file setting an environment variable on session start:

QT_WAYLAND_FORCE_DPI=120

With that, everything was bonkers. I don't remember why I have set it up, but after removing it - Plasma 6 now behaves as expected.