autodestroy sigleton tabgroups

BUG: 299103
FIXE-IN: 4.9
REVIEW: 104975
This commit is contained in:
Thomas Lübking 2012-04-30 22:10:32 +02:00
parent 174e16a74f
commit 2e7e5d2b41

View file

@ -149,6 +149,14 @@ bool TabGroup::remove(Client* c, const QRect& newGeom)
m_clients.removeAt(index);
updateMinMaxSize();
if (m_clients.count() == 1) { // split
remove(m_clients.at(0), m_clients.at(0)->geometry());
}
if (m_clients.isEmpty()) { // remaining singleton "tab"
c->setClientShown(true);
return true; // group is gonna be deleted after this anyway
}
if (c == m_current) {
m_current = index < m_clients.count() ? m_clients.at(index) : m_clients.last();
m_current->setClientShown(true);