diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 1cf9f98f47..0b480f229b 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -1539,7 +1539,6 @@ void AbstractClient::setupWindowManagementInterface() w->setKeepBelow(keepBelow()); w->setMaximized(maximizeMode() == KWin::MaximizeFull); w->setMinimized(isMinimized()); - w->setOnAllDesktops(isOnAllDesktops()); w->setDemandsAttention(isDemandingAttention()); w->setCloseable(isCloseable()); w->setMaximizeable(isMaximizable()); @@ -1652,6 +1651,10 @@ void AbstractClient::setupWindowManagementInterface() for (const auto vd : qAsConst(m_desktops)) { w->addPlasmaVirtualDesktop(vd->id()); } + // We need to set `OnAllDesktops` after the actual VD list has been added. + // Otherwise it will unconditionally add the current desktop to the interface + // which may not be the case, for example, when using rules + w->setOnAllDesktops(isOnAllDesktops()); // Plasma Virtual desktop management // show/hide when the window enters/exits from desktop