Bug 327524 - Plasma relocates bottom-docked panels on top of each other when secondary screen is disconnected
Summary: Plasma relocates bottom-docked panels on top of each other when secondary scr...
Status: RESOLVED DUPLICATE of bug 356225
Alias: None
Product: plasma4
Classification: Plasma
Component: panel (show other bugs)
Version: 4.10.5
Platform: Debian unstable Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-12 21:09 UTC by Oxan van Leeuwen
Modified: 2018-01-23 22:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oxan van Leeuwen 2013-11-12 21:09:57 UTC
When Plasma relocates panels after it detects a screen has gone missing, it overlays them on top of each other.

The relevant code segment is the PlasmaApp::canRelocatePanel() function from kde-workspace.git/plasma/desktop/shell/plasmaapp.cpp. This function should prevent two panels from being overlaid on top of each other, but that doesn't always work. 

The debug output from this function (in my case) is:
plasma-desktop(6166)/plasma PlasmaApp::canRelocatePanel: testing: 0 PanelView(0x24f4d10) QRect(0,0 1920x35) 4 QRect(0,1044 1920x-1009)
plasma-desktop(6166)/plasma PlasmaApp::canRelocatePanel: PanelView(0x24c2bc0) 0 0 4 QRect(0,1045 1920x35)
plasma-desktop(6166)/plasma PlasmaApp::canRelocatePanel: PanelView(0x24f4d10) -1 -1 4 QRect(0,0 1920x35)

The panel from the removed screen (PanelView(0x24f4d10)) is relocated on top of the panel from the existing screen (PanelView(0x24c2bc0)) afterwards. My hypothesis is that the problem is with the setX() and setY() calls while calculating the new geometry: these functions don't move the QRect, but change only the top-left point, while keeping the bottom-right point intact. This means that the panel is dramatically resized, instead of only moved (as proven by the new geometry on the first debug line, which indicates a size of 1920x-1009). I'm quite surprised the panel actually nicely shows up at the bottom of the screen. I suspect replacing the setX() and setY() calls with moveLeft() and moveTop() calls will fix the problem; but I haven't tried that (no development setup on this laptop yet). 

This bug is a part of the bugs repoted in #295784, #326772, #323056 and probably others I didn't find.

Thanks in advance for your time.

Reproducible: Always

Steps to Reproduce:
1. Attach a second screen to your computer and dynamically set it up through the Display Settings utility
2. Add an empty Plasma panel to the secondary screen and dock it to the bottom
3. Disconnect the screen (nothing happens here for me)
4. Logout from KDE
5. Login again
Actual Results:  
There are now two overlapping panels on my laptop screen: the original panel, and the empty panel of the secondary screen on top of it.

Expected Results:  
The empty panel from the secondary screen should've been deleted or not touched at all, it shouldn't have been put on top of an existing panel.
Comment 1 Nate Graham 2018-01-23 22:27:48 UTC

*** This bug has been marked as a duplicate of bug 356225 ***