From 7578016b721c6588629c22df7dc200bc9ad5cbfa Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Mon, 14 Dec 2009 12:39:33 +0000 Subject: [PATCH] If two windows cannot have the same geometry then don't allow them to be grouped. svn path=/trunk/KDE/kdebase/workspace/; revision=1062354 --- clientgroup.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/clientgroup.cpp b/clientgroup.cpp index bec3a9c629..a526a5c0db 100644 --- a/clientgroup.cpp +++ b/clientgroup.cpp @@ -52,12 +52,21 @@ void ClientGroup::add( Client* c, int before, bool becomeVisible ) if( contains( c ) || !c->workspace()->decorationSupportsClientGrouping() ) return; - // If it's not possible to move both windows on to the same desktop then ungroup them + // If it's not possible to have the same states then ungroup them, TODO: Check all states // We do this here as the ungroup code in updateStates() cannot be called until add() completes + QRect oldGeom = c->geometry(); + if( c->geometry() != clients_[visible_]->geometry() ) + c->setGeometry( clients_[visible_]->geometry() ); + if( c->geometry() != clients_[visible_]->geometry() ) + return; if( c->desktop() != clients_[visible_]->desktop() ) c->setDesktop( clients_[visible_]->desktop() ); if( c->desktop() != clients_[visible_]->desktop() ) + { + if( c->geometry() != oldGeom ) + c->setGeometry( oldGeom ); // Restore old geometry return; + } // Tabbed windows MUST have a decoration if( c->noBorder() ) @@ -242,7 +251,9 @@ void ClientGroup::updateStates( Client* main, Client* only ) if( (*i)->keepBelow() != main->keepBelow() ) (*i)->setKeepBelow( main->keepBelow() ); - // If it's not possible to move both windows on to the same desktop then ungroup them + // If it's not possible to have the same states then ungroup them, TODO: Check all states + if( (*i)->geometry() != main->geometry() ) + remove( *i ); if( (*i)->desktop() != main->desktop() ) remove( *i ); }