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 @@ -418,6 +420,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 @@ -553,6 +553,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 @@ -322,6 +322,7 @@ if (c->wantsInput() && !c->isMinimized()) { activateClient(c); } + updateTabbox(); connect(c, &ShellClient::windowShown, this, [this, c] { updateClientLayer(c); @@ -340,6 +341,7 @@ ); connect(c, &ShellClient::windowHidden, this, [this] { + // TODO: update tabbox if it's displayed markXStackingOrderAsDirty(); updateStackingOrder(true); updateClientArea(); @@ -370,6 +372,7 @@ markXStackingOrderAsDirty(); updateStackingOrder(true); updateClientArea(); + updateTabbox(); } ); } @@ -653,10 +656,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) @@ -708,14 +708,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) @@ -1781,5 +1775,14 @@ ); } +void Workspace::updateTabbox() +{ +#ifdef KWIN_BUILD_TABBOX + if (TabBox::TabBox::self()->isDisplayed()) { + TabBox::TabBox::self()->reset(true); + } +#endif +} + } // namespace