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: generic-multiscreen (show other bugs)
Version: 5.26.5
Platform: openSUSE 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: 2023-05-29 20:34 UTC (History)
19 users (show)

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


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.
Comment 23 Alain Knaff 2022-12-16 12:45:19 UTC
It looks as if the problem happens much less often when checking the box "Save display's properties: For any display arrangement" in SystemSettings->Hardware->"Display and Monitor"->"Display Configuration"
Comment 24 Vit Pelcak 2023-02-01 07:47:23 UTC
Hello.

It just happened to me. 

I have a laptop with 2 other screens.
Now I took laptop and connected it to other 2 screens and boom, no panel at all.

> cat ~/.config/plasmashellrc
[Open-with settings]
CompletionMode=1
History=firef

[PlasmaTransientsConfig]
PreloadWeight=0

[PlasmaViews][Panel 29]
alignment=1
panelOpacity=0
panelVisibility=0

[PlasmaViews][Panel 29][Defaults]
maxLength=1920
minLength=1920
thickness=44

[PlasmaViews][Panel 29][Horizontal1050]
thickness=44

[PlasmaViews][Panel 29][Horizontal1366]
thickness=44

[PlasmaViews][Panel 29][Horizontal1920]
maxLength=1920
minLength=1920
thickness=44

[PlasmaViews][Panel 4][Defaults]
thickness=44

[PlasmaViews][Panel 4][Horizontal1366]
thickness=44

[ScreenConnectors]
0=DP-1-3
1=DP-1-1
2=HDMI-1
3=eDP-1

[Updates]
performed=/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/systemloadviewer_systemmonitor.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/maintain_existing_desktop_icon_sizes.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/klipper_clear_config.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/no_middle_click_paste_on_panels.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/digitalclock_rename_timezonedisplay_key.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/containmentactions_middlebutton.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/digitalclock_migrate_font_settings.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/keyboardlayout_migrateiconsetting.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/move_desktop_layout_config.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/unlock_widgets.js,/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/keyboardlayout_remove_shortcut.js

Latest openSUSE Tumbleweed.

Kernel: 6.1.8-1-default
plasma-framework-5.102.0
plasma5-workspace-5.26.5
libQt5Core5-5.15.8

Workaround from comment 13 worked for me.

Then I did:
- kquitapp5 plasmashell
- Edit ~/.config/plasmashellrc and remove all entries under [ScreenConnectors]
- kstart5 plasmashell && kquitapp5 plasmashell

and panel appeared.

And in ~/.config/plasmashellrc I found:
[ScreenConnectors]
0=eDP-1
1=DP-1-1
2=DP-1-3

Thing is, that selecting some screen as primary will make panel appear elsewhere.

I had to set 0=eDP-1 as primary to have it appear on 1=DP-1-1.
Comment 25 Marco Martin 2023-02-01 11:08:30 UTC
architecture-wise this changed completely in 5.27 and screen connectors are not used anywhere anymore
Comment 26 leonardopsantos 2023-05-15 14:19:51 UTC Comment hidden (spam)
Comment 27 Nate Graham 2023-05-15 16:29:26 UTC Comment hidden (spam)
Comment 28 leonardopsantos 2023-05-29 20:34:51 UTC
(In reply to Nate Graham from comment #27)
> > I'm getting the exact same problem: KDE will randomly loose the displays and panels configuration.
> Unfortunately it turns out that there are many potential root causes when
> this happens, and the root cause of the specific issue you're seeing may not
> be the same as the one for this bug report Can you submit a new bug report
> for your issue? If it does end up being the same thing, we can mark it as a
> duplicate of this bug report and then re-open it. But if it's something
> else, then it will be good to have a separate bug report for it.
> 
> Thanks!

Bug #470429 submitted