Plasma breaks when switching off monitor

I have a monitor with Display Port. When I switch it off, this is basically equal to plugging it. Whenever I switch it off (or set my computer to sleep) and reenable it, my taskbar appears on another screen and my desktop wallpapers are scrambled.
In more detail: I have three displays, my main monitor is in the middle. I have two taskbars. One is always on my main screen, and is not affected. If the second one is on my right screen, it appears on the main screen.
If the task bar is on the left screen, it appears on the right scren.
The wallpaper from the left screen always appears on the right screen.

If I also have Kronhkite enabled, in addition the wallpaper on the desktop where the DP-Monitor is on, goes black. Executing kquitapp5 plasmashell; kstart5 plasmashell fixes the black screen. But I always have to move the taskbar to it’s correct place.

I assume the problem is, that my primary monitor is the one with display port, so Plasma switches my primary monitor to another one, and therefore scrambles my settings.

I assume that this is related: Weird behaviour on active workspace after disabled screen

This is a known bug with Plasma, I’ve never experienced it personally, because I do not unplug my monitors while the computer is running, but I’ve heard a lot of people complain about it.

KDE developers are aware of it and I’m sure it will be fixed in one of the upcoming updates, but who knows when. At the moment, there is nothing you can do about it, apart from not switching off monitors or using a workaround as described on the Arch wiki (which may or may not work):

https://wiki.archlinux.org/title/KDE#Missing_panels/widgets

1 Like

Thanks for the reply! The wiki says

by changing the lastScreen values.

What would I have to change them to? I guess it’s screen numbers, but what is “lastScreen”?

I tried saving the file before suspending, and then copying it back. This does not have any effect. When restarting with kquitapp5 plasmashell; kstart5 plasmashell the file get’s overwritten again. However, the task bar is now on the left screen, instead of the middle (it should be on the right screen).

Is there a way to load the settings from that file?

Multi monitor in KDE is a mess, for a long time, don’t hold your breathe on a fix.

LOL, how sure? Long standing critical bugs that nobody wants to tackle are KDE’s specialty.

I’ve had a similar issue, but only with switching off a single monitor, so not sure if relevant to this issue. Disabling the Blur desktop effect fixed it for me, but multi monitor adds another layer of issues.

1 Like

88.5% sure :rofl:

LOL, how would I know?

1 Like

I’ll round that up to 89% then.

:sweat_smile:

1 Like

It was working perfectly for a long time until it started to do this. There must be some fix.

Which update did it break for you?

If you want it fixed the first step is to report it upstream as a regression,if you can pin point the update that broke it it may help someone fix it.

The more info you can provide the better, hopefully a dev picks it up and runs with it, but given the state of the multi monitor code base that may not happen.

I don’t remember, which update it broke. But what I do remember is, that it appeared to coincide with me trying out wayland. However I can’t really imagine how that would have these effects.

@Elendil
I think you can fix it by ignoring the KDE settings and manually configuring xorg.

Interesting. How can I configure xorg.conf with a turned-left monitor, and a monitor with 165hz?

I don’t really have a specific answer but i think it’s possible to get it working.

https://wiki.archlinux.org/title/Multihead

I read this article. But I didn’t find the necessary information there.

Does restarting X11 after switching monitor back on help?

kwin_x11 --replace&
1 Like

no

Not a solution per se but through fooling around i found out that keeping your main screen leftmost one (topleft pixel is 0,0 coordinates) fixes this kind of problems for me (on both KDE and when i used to use Gnome). It makes it so that moving windows around (please don’t torch me :smiley: ) janky at best but i never had to reconfigure my screen setup after boot again. All in all this was a few months ago, at the moment i only have space for 1 monitor due to working from home (work pc is also on the same desk) so i’m not sure how this workaround stands now.

1 Like

Multiple monitors, different aspect ratios, different refresh rates … not a good combo for KDE, historically it does not handle this well.

Sounds like what you are describing is a regression, lots of work is being done on wayland, your xorg config may have been inadvertantly changed when you tried wayland.

I would search the Arch forum for similar issues after trying wayland, search KDE bugs for similar known issues, internet search in general to determine if someone else has experience the same thing.

Without being able to reproduce it is near impossible to help effectively.

What about keeping monitor power on but using kwin screen switching off function? You can manually set a keyboard shortcut for this, I don’t think it has one by default.

2022-01-25-off

Last resort Gnome multi monitor support is much better than KDE.

Everything about how bad is Plasma on multi-monitors is already said.
Apart from advice to use a different DE (I would recommend bspwm), I suggest you try Latte dock, which has a lot of advanced features to handle the multi-monitors problems, in combination with keyboard shortcuts, one for restart plasma and one for restart kwin.

Prognosis on when Plasma will terminally fix monitor handling look like a deep black hole :hole:

I made a script of which I think it fixes the problem. Need to test it further, though:

#!/bin/sh

kwin_x11 --replace & disown
kquitapp5 plasmashell
kstart5 plasmashell

Is there a way to execute this on every wake from sleeping or energy saving screen disabling?

Edit: The script works reliable.

Btw: The latest Plasma update made the problem better, but it didn’t go away. The script still works, though.

Not a good idea, when using KDE. It’s far from being ready for use with this DE. There could be a lot of things that have been screwed.