Bug 353053

Summary: After screen geometry changes: Maximized windows ignore panel; grow behind it
Product: [Plasma] plasmashell Reporter: Ralf Jung <post>
Component: PanelAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: amantia, kde, mklapetek, Ondrej.Machulda, post, tamius.han, thomas.luebking, vicr12345
Priority: NOR    
Version: 5.4.1   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: xprop of broken panel
xrandr before step 2
xrandr after step 2
Extra xrandr/xprop

Description Ralf Jung 2015-09-22 17:42:16 UTC
After changing from the external screen to the laptop screen or vice versa, maximized windows no longer take the panel into account: They become as large as the entire screen, with their bottom part being covered by the panel.

Reproducible: Always

Steps to Reproduce:
1. Start a session, on one of two screens of different resolutions
1a. Have a panel at the bottom, and no other panel
2. Use xrandr or whatever to move things to the other screen
3. Maximize any window

Actual Results:  
The bottom part of the window is covered by the panel.

Expected Results:  
Maximizing should take the panel into account, and should resize the windows such that the panel doesn't cover any part of them.

This is a very bad regression compared to KDE4. I now have to restart Plasma several times a day to fix the panel geometry...

I am using Debian testing and Qt 5.5. Whether this bug is in Plasma or kwin I don't know.
Comment 1 David Edmundson 2015-10-02 13:53:32 UTC
Can you run 
"xprop" and click on the panel please

also output of xrandr before and after step 2.
Comment 2 Ralf Jung 2015-10-04 14:24:53 UTC
Created attachment 94836 [details]
xprop of broken panel
Comment 3 Ralf Jung 2015-10-04 14:25:08 UTC
Created attachment 94837 [details]
xrandr before step 2
Comment 4 Ralf Jung 2015-10-04 14:25:26 UTC
Created attachment 94838 [details]
xrandr after step 2
Comment 5 tamius.han 2015-10-13 10:50:18 UTC
Created attachment 94982 [details]
Extra xrandr/xprop

I'm having the same problem (except on version 5.4.2 on arch packages), figured I might add my data as well.
Comment 6 Ondrej Machulda 2015-10-14 20:56:59 UTC
*** Bug 353693 has been marked as a duplicate of this bug. ***
Comment 7 Ondrej Machulda 2015-10-14 21:00:53 UTC
I have a bit different steps to reproduce (originally reported in https://bugs.kde.org/show_bug.cgi?id=353693 - see also xrandr and xprops output attached there): just switch between two displays and on the newly enabled display the windows do not respect the panel.

I also found a workaround - kill and restart just the plasmashell process.
Comment 8 Victor Tran 2015-10-15 04:52:18 UTC
Or, another non-drastic workaround, open the panel's settings > more settings > Auto hide, then click outside so the panel settings closes. Reopen the panel settings > more settings > keep visible.
Comment 9 Gero Müller 2015-12-14 08:21:47 UTC
Hello, this bug is still present in KDE 5.5.0 and qt 5.5.1 on Archlinux with Intel Broadwell Chip. Please fix this, it is a very annoying bug for my daily work. Thanks!
Comment 10 András Manţia 2015-12-18 08:08:33 UTC
The same problem happens for panels added to the secondary screen in a dual-screen setup.
Comment 11 Ralf Jung 2016-01-17 15:22:19 UTC
This is still a problem in the version in Debian right now (plasma-desktop 5.4.3). It is one of a series of bugs that makes working with KDE on a dynamic multi-screen setup pretty much impossible.

I think all the information that has been asked for has been provided. Why is this bug still "NEEDSINFO"?
Comment 12 Ralf Jung 2016-03-19 09:27:01 UTC
Rather embarrassingly, this issue persists with Plasma 5.6 (from KDE experimental). Furthermore, nobody even bothered to to unset the NEEDSINFO flag after all information htat has been asked for, has been provided.

I will now set this bug to CONFIRMED. Maybe that helps?
Comment 13 Martin Klapetek 2016-03-21 22:12:32 UTC

*** This bug has been marked as a duplicate of bug 348043 ***
Comment 14 Thomas Lübking 2016-03-23 12:08:49 UTC
Fvwi, bug #360828 has a zero strut where the other ones seem to have a negative one.
Latter are likely to be due to miscalculation (window, rather than root geometry) in a multiscreen setup but former is just plain broken (it's a singlescreen setup)
Comment 15 Martin Klapetek 2016-03-23 13:01:59 UTC
Yes, I'm aware. I marked these as duplicates cause in both cases the cause is the same - wrong struts. So if/when someone will investigate the code for struts, I'm hoping that someone will also test it and/or have it tested in multiscreen setup, killing two bugs with the same cause at once.
Comment 16 Thomas Lübking 2016-03-24 00:38:28 UTC
The panelview uses KScreen & QScreen concurrently what bears a great potential for races (kscreen reads randr event, fires signal, panelview acts, qscreen reads event and updates its members)

WIth the local screen implementation in KWin (Martin discarded QScreen; no idea about kscreen, but half of the "help, my desktop is weird" forum posts relate to it...) we've 3(!!!) screen implementations around... but screens aren't relevant to smartphones, so why bother. *shrug*
Comment 17 Martin Klapetek 2016-03-24 00:43:14 UTC
https://git.reviewboard.kde.org/r/125451/
Comment 18 David Edmundson 2016-03-24 00:46:39 UTC
Kwin does use QScreen (indirectly)
QDesktopWidget (which kwin uses) was ported to be a thin layer over QScreen API.

You're right about the cause of the screen problem, problem is it it's not as simple as porting to:
        const QRect thisScreen = corona()->screenGeometry(containment()->screen());

as we're calling updateStruts() from both a QScreen related signal and a kscreen related one.
The first one we can't port from as easily.

Qt 5.6 brought fixes we need, which means Plasma 5.7 can finally use one (well, two if you count Corona) API.

Yes the situation is broken, but it does have nothing to do with smartphones so can you avoid the snarky comments.
Comment 19 Thomas Lübking 2016-03-24 01:13:55 UTC
Afaics, QDesktopWidget is only used (as a single remainder, looks like an oversight) in scripting/workspace_wrapper.cpp and some kcms.
Comment 20 Ralf Jung 2016-03-24 07:39:17 UTC
QDesktopWidget is also broken, at least in Qt 5.5 and (if I read the code correctly) still in 5.6: <https://bugreports.qt.io/browse/QTBUG-52101>