The primaryOutput method in KScreen is not consistent with Output::isPrimary
and made plasma shell become a bit inconsistent too.
Loop through the outputs for now, until we've got a better solution.
BUG: 338109
CCBUG: 335710
Have separate code paths instead, otherwise we'd end up inserting the same
containments twice.
Also add an assert to make sure this doesn't happen anymore.
CCBUG:337928
So far, when initializing plasma shell some plasmoids would trigger a
warning in ShellCorona::screenForContainment saying that the requested
screen was not found.
This patch fixes the issue by introducing the screens to the views list
earlier, this way when screenForContainment is called, we already have
the list initialized. Now the problem is that we get some inconsistencies,
because QApp::processEvents is called from within View::setContainment.
This results in requests to the PlasmaShell on half-baked instances and
resulted in problems. That's why I introduced the loading attribute that
wraps setContainment calls.
REVIEW: 119554
if there isn't a containment existing for the screen, create it.
even if the whole corona is locked.
needed for instance if a new screen is conencted and we're locked
or a locked sessin starts with a malformed appletsrc
BUG:337200
if there isn't a containment existing for the screen, create it.
even if the whole corona is locked.
needed for instance if a new screen is conencted and we're locked
or a locked sessin starts with a malformed appletsrc
BUG:337200
Make sure the screen is not added until the containment is defined and the
screen is shown.
Don't check if a screen is redundant to itself.
Also delay output redundancy using the timer, until the screen is taken
care for. Also delay the timer a bit further as all the screen management
takes quite some time.
Only set the screen right before triggering show(), otherwise it can mess
up for reasons I don't know.
Also I prefer not to pass the screen in the constructor, given that we
move the DesktopView instances across screens and it gives the wrong
impression that the view is tied to the screen.
Rename removeDesktop -> removeScreen
Embrace removeScreen as the procedure to disable a screen.
Don't delay destruction of the panels either, the screen could have been
deleted by then.
::shiftViews seemed like a good idea, but it clearly was not. I promise I
was not on drugs when I decided to use it.
Instead, take a recursive alternative, like we did with insertScreen that
will take care about panels and views.
Don't request geometry of disabled outputs.
Set a random screen to a desktop view before destroying it, otherwise it
goes mental.
Fix assert
Improve debug output
We already used to follow it, but we didn't control most use cases.
Now we'll track the position and geometry changes to make sure that when
they change, redundant outputs can stop being redundant.
Workaround a lack of API from Qt where it will decide to move the panels
around without us being able to control it.
This patch overrides the QWindow::screenDestroyed slot to be able to decide
where to move the Panel or whether it needs to be removed. This is
considered a workaround and should be removed once the new API is in and
released.
See also: https://codereview.qt-project.org/#/c/88351/
BUG: 335710