diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -25,10 +25,12 @@ #include "placement.h" #include "screenedge.h" #include "screens.h" +#ifdef KWIN_BUILD_TABBOX +#include "tabbox.h" +#endif +#include "virtualdesktops.h" #include "wayland_server.h" #include "workspace.h" -#include "virtualdesktops.h" -#include "screens.h" #include "decorations/decorationbridge.h" #include "decorations/decoratedclient.h" #include @@ -386,6 +388,12 @@ void ShellClient::destroyClient() { m_closing = true; +#ifdef KWIN_BUILD_TABBOX + TabBox::TabBox *tabBox = TabBox::TabBox::self(); + if (tabBox->isDisplayed() && tabBox->currentClient() == this) { + tabBox->nextPrev(true); + } +#endif if (isMoveResize()) { leaveMoveResize(); } diff --git a/workspace.h b/workspace.h --- a/workspace.h +++ b/workspace.h @@ -554,6 +554,7 @@ QList session; void updateXStackingOrder(); + void updateTabbox(); AbstractClient* active_client; AbstractClient* last_active_client; diff --git a/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -316,6 +316,7 @@ if (c->wantsInput() && !c->isMinimized()) { activateClient(c); } + updateTabbox(); connect(c, &ShellClient::windowShown, this, [this, c] { updateClientLayer(c); @@ -364,6 +365,7 @@ markXStackingOrderAsDirty(); updateStackingOrder(true); updateClientArea(); + updateTabbox(); } ); } @@ -647,10 +649,7 @@ updateStackingOrder(true); // Propagate new client if (c->isUtility() || c->isMenu() || c->isToolbar()) updateToolWindows(true); -#ifdef KWIN_BUILD_TABBOX - if (TabBox::TabBox::self()->isDisplayed()) - TabBox::TabBox::self()->reset(true); -#endif + updateTabbox(); } void Workspace::addUnmanaged(Unmanaged* c) @@ -702,14 +701,8 @@ emit clientRemoved(c); updateStackingOrder(true); - -#ifdef KWIN_BUILD_TABBOX - TabBox::TabBox *tabBox = TabBox::TabBox::self(); - if (tabBox->isDisplayed()) - tabBox->reset(true); -#endif - updateClientArea(); + updateTabbox(); } void Workspace::removeUnmanaged(Unmanaged* c) @@ -1770,5 +1763,14 @@ ); } +void Workspace::updateTabbox() +{ +#ifdef KWIN_BUILD_TABBOX + if (TabBox::TabBox::self()->isDisplayed()) { + TabBox::TabBox::self()->reset(true); + } +#endif +} + } // namespace