Bug 344076 - Panels appear on top of each other when switching back to single-monitor
Summary: Panels appear on top of each other when switching back to single-monitor
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-multiscreen (show other bugs)
Version: 5.2.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks: 328593
  Show dependency treegraph
 
Reported: 2015-02-12 12:06 UTC by Bas van Schaik
Modified: 2016-09-20 14:04 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Panels distributed over three screens (938.53 KB, image/jpeg)
2015-02-13 14:40 UTC, Bas van Schaik
Details
Panels after disconnecting the two external displays (307.47 KB, image/jpeg)
2015-02-13 14:40 UTC, Bas van Schaik
Details
WORKING plasma-org.kde.plasma.desktop-appletsrc (24.97 KB, text/plain)
2016-07-12 13:21 UTC, soee
Details
PANEL MOVED plasma-org.kde.plasma.desktop-appletsrc (27.10 KB, text/plain)
2016-07-12 13:21 UTC, soee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bas van Schaik 2015-02-12 12:06:18 UTC
I'm using a dynamic multi-monitor setup: in the office my laptop is connected to two additional 2560x1440 displays, but on the road it's just the laptop screen. Each of the external displays has a default panel configured at the bottom of the screen. However, when disconnecting the external displays, the two panels from those displays show up on top of each other on my laptop display. Additionally, notifications appear three times.

Might it be possible to hide panels that are configured to appear on a display that is currently not connected, and put those panels back into place when the external displays are reconnected?

Reproducible: Always

Steps to Reproduce:
1. connect external display(s), set up extra panels on the display(s)
2. disconnect external display

Actual Results:  
Panels that were previously shown on the external display show up on the internal (laptop) display, stacked on top of each other.

Expected Results:  
Panels that belong to a display that is currently not connected should be hidden.
Comment 1 Marco Martin 2015-02-13 13:23:17 UTC
immediately or after plasma restart?

here the panel on the second screen is not moved, not reproducible
Comment 2 Bas van Schaik 2015-02-13 14:40:07 UTC
Created attachment 91049 [details]
Panels distributed over three screens
Comment 3 Bas van Schaik 2015-02-13 14:40:41 UTC
Created attachment 91050 [details]
Panels after disconnecting the two external displays
Comment 4 Bas van Schaik 2015-02-13 14:41:17 UTC
It happens in the same session - no restarting of plasma required. I've just added two screenshots:
 - panels-3screens.jpg: the original configuration of 3 panels, one per monitor (two external monitors, one laptop LVDS display)
 - panels-1screen-stacked.jpg: screenshot taken immediately after (1) disconnecting the two external monitors and (2) running xrandr to set the right configuration.

The latter shows the panels on top of each other. I can't quite see whether it's all three on top of eachother, or just two of them.

When I reconnect the two external monitors (and update the configuration using xrandr), often one of the panels is put back onto the correct monitor, and one panel ends up either floating in the middle of one of the monitors, or stays on top of the primary (LVDS) display's panel.
Comment 5 Aaron 2015-04-26 04:52:27 UTC
I am able to reproduce this error on fedora 21. I have the same setup with two external monitors. Upon disconnect and reboot I have the panels displaying on top of each other on the laptop monitor.
Comment 6 Bas van Schaik 2015-09-09 09:24:58 UTC
I've just upgraded to Plasma 5.4 (with kwin 5.4), and this problem persists.
Comment 7 Bas van Schaik 2015-09-15 11:49:09 UTC
Problem still persists in Plasma/KWin 5.4.1. Is there anything else I can do to help?
Comment 8 S. Bryant 2016-04-13 11:57:59 UTC
I'm using Plasma 5.6.2 on OpenSUSE Leap, and the problem is very much still there.

When I connect my external screen to the laptop, the panel from the laptop screen may get moved to the external screen (or moved back if it was on the external screen).  The panel on the external screen doesn't get moved.

Connecting/disconnecting the external screen prior to X starting results in the same behaviour as doing so after logging in.

Moving a panel to a specific display/position seemed to help for the remainder of that session, but the behavour reverted at the next login.

Disconnecting the external screen leaves the panels where they are.  While this bug's problem description could be counted as solved, the underlying issue is not.

This problem was never correctly addressed in the previous generation of the software, as there are two opposing use cases:
1. having a panel that always remain visible, and automatically changes screen to do so (and returns to the user's preferred screen when it becomes available again).  This is probably what a user expects when a single panel is in use; Windows also works like this.
2. having panels tied to specific screens, and being unreachable if that particular screen is not connected.

My recommendations:
On screen disconnect, there should be a check that at least one panel remains visible - if not, the first panel should be moved (but the lastScreen setting should not be altered).
On screen connect, each panel should be moved to its 'lastScreen' if there is no panel already at that position on that screen.
The lastScreen setting should only be updated when a panel is created or when the user explicitly moves the panel to a different screen.  (Not sure if this is currently the case.)
Comment 9 Christian Speckner 2016-04-18 08:27:07 UTC
I can confirm this on gentoo / plasma 5.5.5. I work on a laptop that I connect to an external monitor in the office. On connecting the external monitor, the panel occassionally movedsto the external screen. On disconnecting, it sometimes moves back to the laptop screen. I can't see any pattern in the behavior, it appears random.
Comment 10 Rick Beldin 2016-05-25 16:03:04 UTC
I can confirm this behavior on Kubuntu 16.04.  It is present in the latest backports ppa:

http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu xenial main

Plasma versions as of 5/24/2016 

dpkg -l | grep plasma | awk '/ii/ {print $2, $3}' | grep desk
plasma-desktop 4:5.6.4-0ubuntu1~ubuntu16.04~ppa3
plasma-desktop-data 4:5.6.4-0ubuntu1~ubuntu16.04~ppa3
plasma-desktop-dbg 4:5.6.4-0ubuntu1~ubuntu16.04~ppa3
plasma-look-and-feel-org-kde-breezedark-desktop 4:5.6.4-0ubuntu1~ubuntu16.04~ppa1

Typically happens when suspending either docked or undocked and resuming in an 'opposite' state.  Ie;  suspend while docked and resume undocked or vice versa. 

Symptoms: 
panels may appear on wrong screens
panels may appear all on one screen
menus may appear on the wrong screen
Comment 11 soee 2016-07-12 13:19:34 UTC
This problem exists sometimes after system reboot - panel from my laptop screen jumps to connected screen and covers the one that exists there. 

I was asked to post 'working' plasma-org.kde.plasma.desktop-appletsrc file content and after panel jumps/is moved to wrong screen. So check the attached files for them.
Comment 12 soee 2016-07-12 13:21:01 UTC
Created attachment 100035 [details]
WORKING plasma-org.kde.plasma.desktop-appletsrc
Comment 13 soee 2016-07-12 13:21:21 UTC
Created attachment 100036 [details]
PANEL MOVED plasma-org.kde.plasma.desktop-appletsrc
Comment 14 Marco Martin 2016-07-12 13:25:44 UTC
I can confirm, lastscreen of one paned effectively goes from 0 to 1, causing the configuration of the screen to be actually lost.
Comment 15 S. Bryant 2016-07-12 21:20:39 UTC
I'm using Plasma 5.7 on OpenSUSE 42.1, and the problem is very much still there.

The behaviour is now worse than it was before: unplugging the external screen leaves me without any visible panels.  Plugging it back in puts one panel on top of the other.

It is also apparent that panels really don't like to be moved from one screen to another.  They hang on the screen edge and try to not go any further.

The machine (a laptop) has hybrid Intel/Nvidia graphics, in case that makes any difference; it has Bumblebee setup.

Running "xrandr -q" gives sane information about the currently connected screens.  The information is updated when the external screen is plugged in or unplugged.
Comment 16 Piotr Dobrogost 2016-07-16 09:51:52 UTC
I think this could be marked as a duplicate of bug #356225 which has more information and is already confirmed.
Comment 17 Marco Martin 2016-09-20 14:04:43 UTC
after the last fixes i can't reproduce anymore.
multiscreen management of plasmashell changed in 5.8, please reopen if the same problem happens in Plasma 5.8 or newer