Move keep-above clients to the Normal layer when showing desktop

Summary:
Implementation of the Show Desktop feature moves desktop windows to
the Above layer, but it doesn't take into account existing clients
that belong to the Above layer. If there are any, we have to move
them to a layer below (e.g. normal), otherwise those clients will be
visible when showing the desktop.

BUG: 406101

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20153
icc-effect-5.17.5
Vlad Zagorodniy 2019-04-01 10:02:20 +03:00
parent 68fca9a613
commit 1e2a0028c3
2 changed files with 4 additions and 2 deletions

View File

@ -374,7 +374,7 @@ Layer AbstractClient::belongsToLayer() const
if (isActiveFullScreen())
return ActiveLayer;
if (keepAbove())
return AboveLayer;
return workspace()->showingDesktop() ? NormalLayer : AboveLayer;
return NormalLayer;
}

View File

@ -1276,7 +1276,9 @@ void Workspace::setShowingDesktop(bool showing)
for (int i = stacking_order.count() - 1; i > -1; --i) {
AbstractClient *c = qobject_cast<AbstractClient*>(stacking_order.at(i));
if (c && c->isOnCurrentDesktop()) {
if (c->isDock()) {
// When showing desktop we'd like to raise docks above desktop
// windows and move keep-above clients to the normal layer.
if (c->isDock() || c->keepAbove()) {
c->updateLayer();
} else if (c->isDesktop() && c->isShown(true)) {
c->updateLayer();