diff --git a/client.cpp b/client.cpp index b555c11cc6..43296b3a06 100644 --- a/client.cpp +++ b/client.cpp @@ -1849,13 +1849,15 @@ bool Client::tabTo(Client *other, bool behind, bool activate) return true; } -bool Client::untab(const QRect &toGeometry) +bool Client::untab(const QRect &toGeometry, bool clientRemoved) { TabGroup *group = tab_group; if (group && group->remove(this)) { // remove sets the tabgroup to "0", therefore the pointer is cached if (group->isEmpty()) { delete group; } + if (clientRemoved) + return true; // there's been a broadcast signal that this client is now removed - don't touch it setClientShown(!(isMinimized() || isShade())); bool keepSize = toGeometry.size() == size(); bool changedSize = false; diff --git a/client.h b/client.h index cd0cc47cd8..dbc7ca9d86 100644 --- a/client.h +++ b/client.h @@ -556,7 +556,7 @@ public: * WARNING: non dynamic properties are ignored - you're not supposed to alter/update such explicitly */ Q_INVOKABLE void syncTabGroupFor(QString property, bool fromThisClient = false); - Q_INVOKABLE bool untab(const QRect &toGeometry = QRect()); + Q_INVOKABLE bool untab(const QRect &toGeometry = QRect(), bool clientRemoved = false); /** * Set tab group - this is to be invoked by TabGroup::add/remove(client) and NO ONE ELSE */ diff --git a/workspace.cpp b/workspace.cpp index 63f675eded..df0b043cd3 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -649,7 +649,7 @@ void Workspace::removeClient(Client* c, allowed_t) m_userActionsMenu->close(); } - c->untab(); + c->untab(QRect(), true); if (client_keys_client == c) setupWindowShortcutDone(false);