Bug 445680 - Wayland - HiDPI screen scaling broken after login to the desktop
Summary: Wayland - HiDPI screen scaling broken after login to the desktop
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.23.3
Platform: Arch Linux Linux
: HI normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2021-11-18 08:53 UTC by Sławek
Modified: 2021-12-05 08:34 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sławek 2021-11-18 08:53:57 UTC
SUMMARY
I'm using Plasma on Arch Linux Lince some time and I'm pretty happy with it. Recently I moved from FullHD external monitor to 27 inch 4K. Monitor is connected to the TB dock (Lenovo Thunderbolt 3 Dock Gen 2) using DP port. Because scaling on such screens is much better on Wayland IMO, I moved to the Wayland now. And here is the problem which I have:

I configured it like: "resolution 3840x2160", "Scale 150%" - that works very good for me. But after I e.g restart my laptop and login into plasma desktop, it has just FullHD resolution on the screen. But the problem isn't the wrong resolution configure really (that I could easily change in settings :). The main issue is that in plasma settings it's still "resolution 3840x2160", "Scale 150%" thus on the screen I really see just 1/4 of the desktop (bottom left corner). To fix it I need to run krunner and with that turn on systemsettings. Then go to the display settings, change resolution of the screen to some other than 3840x2160, apply and confirm new settings and then configure again correct resolution to have everything working fine :)

There is also problem that when there is that wrong resolution configured, mouse coursor is also working in weird way. It isn't really in the place where it should be so to fix resolution settings first I need to do all of that "blindly" :)


STEPS TO REPRODUCE
1. Set 4K display resolution to 3840x2160 and scalling to 1.5
2. Reboot OS or log out and then log in back to the desktop

OBSERVED RESULT
Only huge lower left corner is shown. Resolutions in Settings is OK and also the mouse did not click in the right place on the high-DPI screen.

EXPECTED RESULT
Desktop should be displayed properly

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-9850H CPU @ 2.60GHz
Memory: 62,5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630


ADDITIONAL INFORMATION
On reddit someone pointed me to the bug https://bugs.kde.org/show_bug.cgi?id=445253. It does sounds a bit similar in terms that You cannot really set proper resolution and scalling just like that as it looks that it's already set properly. To fix the issue You have to change resolution to some different value, apply new settings and then set it again to the wanted one.
But as other symptompts (huge left corner of the desktop displayed only, mouse not working properly) I'm opening new bug for that.
If You think it's the same issue, please mark this as duplicate of the  https://bugs.kde.org/show_bug.cgi?id=445253 :)
Comment 1 Sławek 2021-11-18 15:28:27 UTC
I just hit this issue again after login into the desktop. Here is output of the kscreen-doctor when resolution was broken:

kscreen-doctor -o
Output: 1 unknown eDP-1-unknown disabled connected  Panel Modes: 0:1920x1080@60*! Geometry: 0,0 1920x1080 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic 
Output: 2 Goldstar Company Ltd LG HDR 4K/345575 enabled connected primary Unknown Modes: 0:3840x2160@30 1:2560x1440@60 2:1920x1080@60 3:1920x1080@60 4:1920x1080@60 5:1600x900@60 6:1280x1024@60 7:1280x800@60 8:1280x720@60 9:1280x720@60 10:1280x720@60 11:1024x768@60 12:800x600@60 13:720x480@60 14:720x480@60 15:640x480@60 16:640x480@60 17:640x480@60 18:3840x2160@60*! Geometry: 0,0 2560x1440 Scale: 1.5 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic primary


Then I run kscreen-doctor to fix it:
kscreen-doctor output.1.disable output.2.enable output.2.mode.3840x2160@60 output.2.scale.1.5

but it changed nothing. So I run:
kscreen-doctor output.1.disable output.2.enable output.2.mode.1280x800@60

which changed resolution to 1280x800 and fixed desktop that whole (huge) desktop was displayed and mouse coursor was working properly.

Then I again run 
kscreen-doctor output.1.disable output.2.enable output.2.mode.3840x2160@60 output.2.scale.1.5

And I have fixed my desktop finally :)
Comment 2 Méven Car 2021-12-01 14:40:20 UTC
I couldn't reproduce your issues using a 2560x1440* screen at 1.5 scale with plasma 5.24 (dev version).

My ongoing patch https://invent.kde.org/plasma/kscreen/-/merge_requests/57 has a few fixes that should help your case.
Comment 3 Nate Graham 2021-12-01 14:43:59 UTC
I was able to reproduce this in 5.23 as well, but it's fixed for me now in current git master. I think some code changes already fixed it. That MR also looks like it could help, for any remaining cases.
Comment 4 Sławek 2021-12-05 08:34:22 UTC
Thx a lot. I will be then waiting for 5.24. Now with some simple script which uses kscreen-doctor it's easy for me to fix that resolution after log in to the desktop at least :)