Bug 369420 - After turning off external monitor, taskbar disappears on primary monitor
Summary: After turning off external monitor, taskbar disappears on primary monitor
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-multiscreen (show other bugs)
Version: 5.7.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-27 13:27 UTC by Nicolas F.
Modified: 2016-09-28 11:35 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
org.kde.plasma.desktop-appletsrc (9.75 KB, text/plain)
2016-09-27 15:05 UTC, Nicolas F.
Details
log of plasma crashing as the second monitor gets plugged in, and then being restarted but still messed up (170.32 KB, text/x-log)
2016-09-27 15:16 UTC, Nicolas F.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas F. 2016-09-27 13:27:58 UTC
I connected my Laptop to the TV over HDMI, and first arranged them so that the TV was to the right of my laptop in the monitor arrangement widget. I accidentally set the TV as the primary display at this point. I then proceeded to arrange the TV to be above my laptop display in the widget, and also set it back to be a secondary monitor. At this point, all of your windows should be on the TV, while the task bar is back on the laptop. I played around with the refresh rates of the TV for a bit, but made sure not to set it as a primary display again.

After being done watching my Chinese cartoons, I turned off the TV, and then disconnected the HDMI cable. This resulted in plasmashell suddenly eating my taskbar. I tried resetting the monitor configurations to the default value and made sure multiple times to set my laptop's display as being the primary.

A reboot did not fix the issue, I had to manually add a new default panel to my laptop screen.

Reproducible: Didn't try

Steps to Reproduce:
1. Turn on TV
2. Connect HDMI cable to TV
3. Set TV to be the primary display
4.1 Move TV to the right of the primay display
4.2 Remember that you can also stack them in a vertical manner, so after moving it to the right, move it above the laptop display
5. Set laptop display to be the primary display again, after noticing your mistake
6. Drag a bunch of windows around and play with the refresh rate setting of the TV a little.
7. Turn off the TV before unplugging it, then unplug it.


Actual Results:  
The panel disappears from the primary display, and a new one needs to be added back manually to get a panel again.

Expected Results:  
plasma should not allow a situation where no connected monitor has any panels left, especially if one of them is the primary display.

If someone can tell me whether plasma keeps a file somewhere with all the widget arrangements on different monitors, I can probably more closely identify what exactly happened, since apparently the original panel ended up on a monitor that was not connected, even though at the time of disconnecting a secondary monitor, it was on the proper display.

This happened on X11.
Comment 1 Nicolas F. 2016-09-27 14:55:36 UTC
I've just tried connecting my laptop to the TV again. Everything went a bit crazy. The taskbar disappeared, even though my laptop display was set as the primary output. Plasma ended up crashing (sadly I could not get a crashdump), and I had to reboot the system after disconnecting it from the external TV to even get working compositing again, as windows did not refresh and the background was replaced with black.

I've found some files of interest in my .local and .config:
1. Three files in .local/share/kscreen, which seem to list (in a duplicate manner) configured screens. Here they are, tarred and gzipped: https://fratti.ch/bugdemos/kscreen/kscreen.tar.gz
2. The following lines in .config/plasmashellrc:
[PlasmaViews][Panel 1][Horizontal1920]
length=3779
thickness=30

[PlasmaViews][Panel 16][Horizontal1920]
thickness=36

I'm assuming my original panel, Panel 1, still exists *somewhere*, just not on any physical screens.
Panel 16 seems to be the one I'm currently using and have created after I've encountered the bug, as it is indeed thicker.

Any ideas on how I can get my original panel back, or identify where it even went? (Where does plasma store this info?)
Comment 2 Nicolas F. 2016-09-27 15:05:17 UTC
Created attachment 101317 [details]
org.kde.plasma.desktop-appletsrc

Found where the applet parameters are saved in the elegantly named "plasma-org.kde.plasma.desktop-appletsrc" inside .config.

As you can see, my original panel (referred to as [Containments][1]) has a lastScreen value of 1, whereas my new panel (referred to as [Containments][16]) has one of 0.

What those numbers refer to, I do not know, but I'm fairly sure there's something fucky going on with whatever screen 1 is.
Comment 3 Nicolas F. 2016-09-27 15:16:32 UTC
Created attachment 101319 [details]
log of plasma crashing as the second monitor gets plugged in, and then being restarted but still messed up
Comment 4 Marco Martin 2016-09-28 11:35:59 UTC
multiscreen management completely changed in 5.8
Please reopen if it still happens in Plasma 5.8 or newer