Bug 482974 - Resolution changes after switching off the monitor
Summary: Resolution changes after switching off the monitor
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 6.0.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-09 12:10 UTC by boospy
Modified: 2025-04-02 09:32 UTC (History)
7 users (show)

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


Attachments
drm_info output under wayland with unsupported resolution (202.11 KB, text/plain)
2024-04-26 06:53 UTC, Dorian Han
Details
After wake-up plasma desktop widgets are placed improperly/squeezed onto upper-left corner (204.50 KB, text/plain)
2024-04-28 01:09 UTC, Dorian Han
Details

Note You need to log in before you can comment on or make changes to this bug.
Description boospy 2024-03-09 12:10:36 UTC
SUMMARY
***
Hello all,

since Plasma 6 Update, my screen resolution always changing to the wrong configuration and Hz if i switch off the monitor. And the plasma panel moves to the top of the monitor.

Normaly i have 5120x1440 with 120Hz. So after switch off and on again, i get 3840x1080 with 100Hz. Yes can switch back to the right resolution but i can’t set the right Hz again. So i have a bad screen. The only way to fix this, is to reboot the whole machine. 

I'am using displayport cable for the communication. I have also tested it with HDMI. It also happens there. But can no longer manage the resolution of 5120x1440.



***


STEPS TO REPRODUCE
1.  Login to Plasma Desktop
2.  Switch off the Monitor, wait some seconds
3.  Switch on the Monitor


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 22.04 / 6.0.0
(available in About System)
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
https://discuss.kde.org/t/resolution-changes-after-switching-off-the-monitor/11094
Comment 1 Stephen Baker 2024-03-12 00:31:16 UTC
I have seen this twice myself since switching to KDE 6.

In my case my normal resolution is 3840x2160 and it switches to 1280x1024. I am able to restore everything through display settings, but only if I switch to an intermediate resolution like 1920x1080 first; otherwise I'm unable to click the Apply button and it automatically reverts.
Comment 2 Nate Graham 2024-03-13 17:17:15 UTC
Are either of you using NVIDIA GPUs?

Also, are both of you using Wayland when this happens? Does it happen on X11 too? Or only on one?
Comment 3 boospy 2024-03-13 17:40:08 UTC
Sorry, I forgot to add that. Yes Nvidia 4090GTX. With Wayland i will test it.
Comment 4 boospy 2024-03-14 18:03:34 UTC
X11:
Resolution change only occurs with X11. Plasma occasionally crashes completely when the screen is switched off.
The plasma panel moves to the top of the screen, but not always.
The above only happens when windows are open or the mouse or keyboard are used when the monitor is switched off. The last point also applies to a locked screen. 

Wayland:
Opened windows have different positions and a different size when the monitor is switched on again. Widgets on the desktop are moved. 
Rendering error on the desktop (error message), no more widgets can be edited or new ones added. A restart of Plasma is necessary.

Best result:
I had no changes/crashes with X11 at the time when the screen is locked and the monitor goes into standby with the plasma power policy itself. If you leave the mouse and keyboard alone, everything has been ok so far. But I've only been testing this for 2 days.
Comment 5 Nate Graham 2024-03-14 19:40:08 UTC
Thanks a lot. so it happens on X11 when the monitor is physically switched off, and not when the monitor enters power-save mode via software--do I have that right?
Comment 6 Stephen Baker 2024-03-14 22:21:25 UTC
My situation is so different that it may be completely unrelated:

I am on Wayland, my card is an AMD 7800XT, and I am using the open source mesa drivers.

Unlike boospy I cannot not reproduce on demand, I have seen it happen 2 or 3 times since upgrading to KDE 6. It may be helpful to ignore my situation until I can at least gather some more information and see if the root cause is the same or not.
Comment 7 Zamundaaa 2024-03-15 15:23:20 UTC
Please attach the output of xrandr when the resolution is correct, and when the resolution is wrong
Comment 8 boospy 2024-03-18 18:09:01 UTC
Ok after my tests... at the last day's... I achieved the best results by locking the screen and switching to standby after one minute. The worst thing that could happen when unlocking was that the plasma crashed and restarted by itself after a few seconds. This happens about every 5 times. 

Strangely enough, I haven't managed to change the resolution once in the last few days, even when I switched off the monitor. Strange, if you want to reproduce something, it doesn't work.
Comment 9 Zamundaaa 2024-03-22 14:56:15 UTC
Okay, let's close this as worksforme then. If it happens again, just reopen it
Comment 10 Dorian Han 2024-04-22 06:20:13 UTC
I'm having a very similar issue. When KDE 6 goes to sleep, there is a chance at wake up that a wrong solution was used. This is on a fresh KDE 6.0.3 install on openSUSE Tumbleweed. I'm using a dock and connected with DP 1.4 cable at 4k 120hz. The monitor just says an unusable resolution was detected and cannot be displayed after waking up from sleep. 

Restarted system. Under X11, it was all good until after the splash screen. Issue occurred with same symptom, and I think it was still using the same wrong resolution.  Under Wayland, it returned to the original 4k 120hz resolution.

What I noticed is, if I wake it up right after automatic sleep in a few minutes, I don't see the issue. If I leave it for likely half an hour, it will use a wrong resolution that I have totally no idea of. Sometimes it uses 640x480 and some other times it just show as an unsupported resolution so I have no idea what exactly that was. 

I have a live repro but I don't have a valid video output. What kind of information do you need? I'm using wayland these days.
Comment 11 Zamundaaa 2024-04-25 15:18:44 UTC
If an unusable resolution or 640x480 is used, then that's almost certainly a driver bug; it means it either read wrong data in the EDID or no EDID at all.

> I have a live repro but I don't have a valid video output. What kind of information do you need?
After triggering the problem, ssh in from a different PC (or phone) and save the output of drm_info somewhere and attach it here. It'll contain the list of driver-provided modes
Comment 12 Dorian Han 2024-04-26 06:52:47 UTC
(In reply to Zamundaaa from comment #11)
> If an unusable resolution or 640x480 is used, then that's almost certainly a
> driver bug; it means it either read wrong data in the EDID or no EDID at all.
> 
> > I have a live repro but I don't have a valid video output. What kind of information do you need?
> After triggering the problem, ssh in from a different PC (or phone) and save
> the output of drm_info somewhere and attach it here. It'll contain the list
> of driver-provided modes

It has been a few days since my last comment. The wayland session is totally not usable under my case due to this issue. I set the configs under ~/.local/config/kscreen configs to be readonly, which seems partially helped mitigate the issue on X11 and resulted in less frequent repro(s) of this issue. Here I attached the drm_info output under wayland.
Comment 13 Dorian Han 2024-04-26 06:53:34 UTC
Created attachment 168913 [details]
drm_info output under wayland with unsupported resolution
Comment 14 Zamundaaa 2024-04-27 21:58:27 UTC
drm_info shows a *disconnected* DisplayPort connector, somehow being driven at 640x480... was this while the display showed "unusable resolution was detected"?
Comment 15 Dorian Han 2024-04-27 22:43:35 UTC
(In reply to Zamundaaa from comment #14)
> drm_info shows a *disconnected* DisplayPort connector, somehow being driven
> at 640x480... was this while the display showed "unusable resolution was
> detected"?

Yes the drm information was collected under unusable resolution when trying to log onto wayland session. This happened during initial login not a wake up. Basically, wayland is not usable in my case due to this issue. 

If you want, I can revert the read only mitigation on kscreen config files and try to repro the wake-up issue under x11.
Comment 16 Dorian Han 2024-04-28 01:09:43 UTC
Created attachment 168962 [details]
After wake-up plasma desktop widgets are placed improperly/squeezed onto upper-left corner

Here is the drm_info I collected after wake up. The desktop widgets are squeezed onto upper-left corner of screen. I opened display settings and the resolution shows as normal. I switched to another resolution and switch back then everything back to normal.
Comment 17 boospy 2024-04-29 13:09:28 UTC
I've tested Kubuntu 24.04 for 2 weeks. It also occurred, but much less. Only once in 2 weeks.
Comment 18 Intergalactic Narwhal 2024-07-04 10:14:37 UTC
I *think* I have the same issue. What happens for me:
after a timeout, KDE locks the screen, everything is okay.
after a while, the external monitor (connected over USB-C) turns off as expected.
when I move the mouse, it turns on, but the external monitor has the wrong resolution.
I can log in, use the system as normal, but nothing shows up on the external screen, just the background in the wrong resolution.
I can unplug the USB-C docking station and plug it back again and everything is fixed.
Comment 19 Intergalactic Narwhal 2024-07-04 10:16:24 UTC
I'm on Fedora 40 / KDE 6.1.1. It started when I updated from 6.0.5 to 6.1.1. There was a kernel update as well to 6.9.7.
Comment 20 Nate Graham 2024-07-10 21:23:02 UTC
Ok, so the original issue with the resolution changing was fixed in Plasma 6.1, but the remaining issue about only the wallpaper/desktop having the wrong resolution is Bug 487717.
Comment 21 boospy 2025-04-01 19:12:39 UTC
Can anyone tell me how/where this was fixed? I would like to build it under Kubuntu 24.04 LTS. Because the problem is really getting on my nerves.
Comment 22 Nate Graham 2025-04-02 03:49:38 UTC
I'd recommend upgrading to Kubuntu 24.10, which includes Plasma 6.1.5, which has the fix. Or if you wait a little bit longer, Kubuntu 25.04 will include Plasma 6.1.something.
Comment 23 boospy 2025-04-02 09:32:33 UTC
I'm not a big fan of these intermediate versions (I've always had LTS), but since even Plasma 6.3 is included in 25.04, the thought has crossed my mind.