diff --git a/shell_client.h b/shell_client.h --- a/shell_client.h +++ b/shell_client.h @@ -167,6 +167,7 @@ void addDamage(const QRegion &damage) override; bool belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const override; void doSetActive() override; + bool belongsToDesktop() const override; Layer layerForDock() const override; void changeMaximize(bool horizontal, bool vertical, bool adjust) override; void setGeometryRestore(const QRect &geo) override { diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -449,6 +449,20 @@ << resourceName() << ";Caption:" << caption() << "\'"; } +bool ShellClient::belongsToDesktop() const +{ + const auto clients = waylandServer()->clients(); + + return std::any_of(clients.constBegin(), clients.constEnd(), + [this](const ShellClient *client) { + if (belongsToSameApplication(client, SameApplicationChecks())) { + return client->isDesktop(); + } + return false; + } + ); +} + Layer ShellClient::layerForDock() const { if (m_plasmaShellSurface) { @@ -982,22 +996,9 @@ setActive(true); } - bool breakShowingDesktop = !keepAbove() && !isOnScreenDisplay(); - if (breakShowingDesktop) { - // check that it doesn't belong to the desktop - const auto &clients = waylandServer()->clients(); - for (auto c: clients) { - if (!belongsToSameApplication(c, SameApplicationChecks())) { - continue; - } - if (c->isDesktop()) { - breakShowingDesktop = false; - break; - } - } - } - if (breakShowingDesktop) + if (!keepAbove() && !isOnScreenDisplay() && !belongsToDesktop()) { workspace()->setShowingDesktop(false); + } } void ShellClient::doSetActive()