Bug 427278 - Panel & desktop config of secondary monitor lost after ScreenConnectors renumbering
Summary: Panel & desktop config of secondary monitor lost after ScreenConnectors renum...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Multi-screen support (show other bugs)
Version: 5.18.5
Platform: Kubuntu Linux
: HI normal
Target Milestone: 1.0
Assignee: Aleix Pol
URL:
Keywords:
: 416739 425897 450446 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-10-03 03:18 UTC by Charles Huber
Modified: 2022-08-04 19:05 UTC (History)
16 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Huber 2020-10-03 03:18:05 UTC
SUMMARY
------------------------

The panel and desktop configruation of a monitor can get 'lost' after a ScreenConnectors renumbering, requiring manual editing of plasmashellrc to restore.


STEPS TO REPRODUCE
------------------------

On my dual-monitor setup ~/.config/plasmashellrc looks like this:

[ScreenConnectors]
0=DisplayPort-0
1=DisplayPort-1

DisplayPort-0 is the left display, DisplayPort-1 on the right.

1. Starting x0tigervncserver and connecting from another computer with TigerVNC Viewer 1.11.0 & the "Resize remote session to the local window" option checked ends up with DisplayPort-0 being resized to 800x600 and DisplayPort-1 being shut off.  plasmashellrc ends up looking like this:

x0tightvncserver
[ScreenConnectors]
0=:0.0
1=DisplayPort-0
2=DisplayPort-1

No idea where :0.0 came from during that but it's apparently the primary connector now.

2. Disconnecting from VNC & and using the "Display Configuration" applet to re-enable & re-arrange both monitors like they were before gives me:

[ScreenConnectors]
0=DisplayPort-0
1=:0.0
2=DisplayPort-1


OBSERVED RESULT
------------------------

Now the panel/desktop config for slot 1 is 'lost', stuck on :0.0.  DisplayPort-1 ends up using a default panel & desktop config.

I didn't see an obvious way to fix this situation in any of the System Settings applets.  Editing plasmashellrc to put DisplayPort-1 back on slot 1 like it was in step #1 and restarting plasmashell restores the 'lost' panel/desktop config for DisplayPort-1.


EXPECTED RESULT
------------------------

Ideally once I set things back up in the "Display Configuration" applet then DisplayPort-1 would end up back on slot 1 somehow and my panel/desktop config for that monitor would be restored.


SOFTWARE/OS VERSIONS
------------------------

Kubuntu 20.04, amd64
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Kernel Version: 5.4.0-45-generic
Comment 1 Charles Huber 2020-10-03 03:51:23 UTC
This patch fixes things for me:

https://invent.kde.org/genpfault/plasma-workspace/commit/181fc5746e9b4aaf491a90e76e770df866d880ad
Comment 2 Nate Graham 2020-10-05 21:27:14 UTC
Thanks! Can you please submit that as a merge request? See https://community.kde.org/Infrastructure/GitLab
Comment 3 Bug Janitor Service 2020-10-13 01:57:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/352
Comment 4 Mika Norén 2020-12-02 06:50:17 UTC
Seems related:
https://bugs.kde.org/show_bug.cgi?id=416739
Comment 5 Nate Graham 2020-12-31 01:28:24 UTC
*** Bug 416739 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2020-12-31 01:28:29 UTC
*** Bug 425897 has been marked as a duplicate of this bug. ***
Comment 7 kderemie 2021-08-14 02:24:57 UTC
Same issue, I believe. Would love to see this fixed!
Comment 8 Alain Knaff 2021-11-26 20:33:23 UTC
After a couple of months of tranquility, the issue suddenly reappeared a month ago, with a vengeance :-(

And now it's stuff on *both* monitors that goes wonky.

- Task managers set up to show only tasks from current screen suddenly show stuff from other screen, and only stuff from the other screen (i.e. the task manager on left hand screen shows tasks from right hand screen, and the task manager on right hand screen shows stuff from left hand screen)
- Spacers disappear (i.e. systray and clock move flush left against whatever stuff is on the left hand side of the panel, rather than staying at the right border)
- Occasionally panels disappear altogether (or move to hide under the equivalent panel on the other screen)
- Clock widgets configured to show seconds suddenly no longer show seconds
- Full screen applications move to the other screen

Time to bring out that handy restartPlasmaShell script again, and add a shortcut to it to the panel:

#!/bin/sh

killall plasmashell
nohup plasmashell >/dev/null 2>&1 </dev/null &


Ironically enough, occasionally that shortcut disappears to :-)
Comment 9 Kristian Rink 2021-11-30 06:14:26 UTC
(Just adding myself to the Ccs. Same issue, up-to-date kubuntu 21.10, installed yesterday. Seems related to external monitor and doesn't reproducibly happen with each restart. Will evaluate the workarounds outlined here and see what happens...)
Comment 10 Kristian Rink 2021-12-02 06:17:57 UTC
Wondering, though, whether there's a more reliable workaround for that. Restarting plasma seems to work just sometimes, but sometimes the panel just won't re-appear or apparently there's no way of making it show up again, leaving adding a new panel (and reconfiguring everything inside) the only option. That's pretty tedious if one has a customized panel. :(
Comment 11 Alain Knaff 2021-12-02 06:36:42 UTC
(In reply to Kristian Rink from comment #10)
> Wondering, though, whether there's a more reliable workaround for that.
> Restarting plasma seems to work just sometimes, but sometimes the panel just
> won't re-appear or apparently there's no way of making it show up again,
> leaving adding a new panel (and reconfiguring everything inside) the only
> option. That's pretty tedious if one has a customized panel. :(

After reconfiguring everything as I need it, I store a backup copy of plasma-org.kde.plasma.desktop-appletsrc and plasmashellrc, and the restore those in my restart script:


#!/bin/sh

#kquitapp plasmashell
killall plasmashell
cp -a $HOME/.config/PlasmaBackup/* $HOME/.config/
nohup plasmashell >/dev/null 2>&1 </dev/null &


Of course, after performing a *wanted* change, I have to copy the files over to the reference again.
Comment 12 Kristian Rink 2021-12-02 07:17:56 UTC
(In reply to Alain Knaff from comment #11)
> (In reply to Kristian Rink from comment #10)
> > Wondering, though, whether there's a more reliable workaround for that.
> > Restarting plasma seems to work just sometimes, but sometimes the panel just
> > won't re-appear or apparently there's no way of making it show up again,
> > leaving adding a new panel (and reconfiguring everything inside) the only
> > option. That's pretty tedious if one has a customized panel. :(
> 
> After reconfiguring everything as I need it, I store a backup copy of
> plasma-org.kde.plasma.desktop-appletsrc and plasmashellrc, and the restore
> those in my restart script:
> 
> 
> #!/bin/sh
> 
> #kquitapp plasmashell
> killall plasmashell
> cp -a $HOME/.config/PlasmaBackup/* $HOME/.config/
> nohup plasmashell >/dev/null 2>&1 </dev/null &
> 
> 
> Of course, after performing a *wanted* change, I have to copy the files over
> to the reference again.

Ah cool, thanks, that should do for my purposes too. Not changing desktop too often once it has been set up anyway. :)
Comment 13 Dragoon Aethis 2021-12-19 10:34:11 UTC
Same issue here, and it occurs randomly every now and then... The workaround I've found so far is to:
- kquitapp5 plasmashell
- Edit ~/.config/plasmashellrc and remove all entries under [ScreenConnectors]
- kstart5 plasmashell && kquitapp5 plasmashell
- Read ~/.config/plasmashellrc [ScreenConnectors] to get new screen numbers
- Edit ~/.config/plasma-org.kde.plasma.desktop-appletsrc and manually set lastScreen values for Containments as needed.
- kstart5 plasmashell
Comment 14 Terces86 2022-01-10 14:12:39 UTC
Maybe my issue is connected to this one:
I have two screens and use a KVM to switch between two PCs. I can consistently reproduce the problem by switching the PCs. Every time I switch from my main PC to my work-laptop and back, my second screen has lost its panel and configurations. If I switch to my laptop and PC AGAIN, everything is back the way it was. So every uneven switch, I lose my settings and every even switch I get them back.
I'm using KDE Plasma 5.23.5 with KDE neon 20.04.
Comment 15 Romain Lalaut 2022-01-20 12:19:50 UTC
Same problem here with plasma-worskpace-5.18.5-0ubuntu0.1
I have two monitors (occasionally adding a hdmi TV with another graphic card). My panel is vertical on the left of the left monitor.

The problem occurs randomly after the monitors went to powersave mode (or manually turned off). 

Maybe it could be important, I had to switch the default order of the monitors (DisplayPort-1 is on the left and DisplayPort-0 on the right). And again randomly, I sometimes have to redo that operation (and sometimes one of the monitor is disabled in the system settings).

I don't know if I could be more helpful but this bug drives me crazy :'(
Comment 16 Nate Graham 2022-02-22 17:11:08 UTC
This should be fixed in Plasma 5.25 with a big refactor of how screens are handled. Unfortunately the change was to large to be backportable to 5.24.something.
Comment 17 Nate Graham 2022-02-23 20:03:01 UTC
*** Bug 450446 has been marked as a duplicate of this bug. ***
Comment 18 Nate Graham 2022-02-25 22:36:15 UTC
Good news: we backported it to 5.24.3. :)
Comment 19 Syiad 2022-03-23 14:28:12 UTC
The screen setup is now maintained OK, but the wallpaper (different on primary screen) and the plasma widgets on are lost after rebooting.
Comment 20 Nate Graham 2022-03-24 01:25:47 UTC
It's probably a slightly different issue, unless you can point to unnecessary renumbering in the [ScreenConnectors] group of your ~/.config/plasmashellrc file as specifically still happening. If not, can you file a new bug report?
Comment 21 Syiad 2022-03-25 14:23:31 UTC
The screen connectors are fine, so it really seems to be a different (new) problem.
Comment 22 Terces86 2022-03-25 21:53:13 UTC
(In reply to Syiad from comment #21)
> The screen connectors are fine, so it really seems to be a different (new)
> problem.

You might be having the same error I am getting. The symptoms are already described in another (quite old) bugreport:
https://bugs.kde.org/show_bug.cgi?id=353975
Maybe the panel disappearing and the background disappearing are two separate bugs that get triggered at the same time.