diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 6f0ef457b8..21d0a3523d 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -542,10 +542,11 @@ void AbstractClient::setOnAllDesktops(bool b) if ((b && isOnAllDesktops()) || (!b && !isOnAllDesktops())) return; - if (b) - setDesktop(NET::OnAllDesktops); - else - setDesktop(VirtualDesktopManager::self()->current()); + if (b) { + setDesktops({}); + } else { + setDesktops({VirtualDesktopManager::self()->currentDesktop()}); + } } int AbstractClient::desktop() const diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index f49879377b..0fa13380e2 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -358,7 +358,7 @@ XdgToplevelClient::XdgToplevelClient(XdgToplevelInterface *shellSurface) { setupWindowManagementIntegration(); setupPlasmaShellIntegration(); - setDesktop(VirtualDesktopManager::self()->current()); + setDesktops({VirtualDesktopManager::self()->currentDesktop()}); #if KWIN_BUILD_ACTIVITIES if (auto a = Activities::self()) { setOnActivities({a->current()}); @@ -1739,7 +1739,7 @@ XdgPopupClient::XdgPopupClient(XdgPopupInterface *shellSurface) : XdgSurfaceClient(shellSurface->xdgSurface()) , m_shellSurface(shellSurface) { - setDesktop(VirtualDesktopManager::self()->current()); + setDesktops({VirtualDesktopManager::self()->currentDesktop()}); #if KWIN_BUILD_ACTIVITIES if (auto a = Activities::self()) { setOnActivities({a->current()});