diff --git a/client.cpp b/client.cpp index 7ad2e7e9e6..3fa930b664 100644 --- a/client.cpp +++ b/client.cpp @@ -246,7 +246,7 @@ void Client::releaseWindow( bool on_shutdown ) destroyDecoration(); cleanGrouping(); if( clientGroup() ) - clientGroup()->remove( this ); + clientGroup()->remove( this, QRect(), true ); if( !on_shutdown ) { workspace()->removeClient( this, Allowed ); @@ -310,7 +310,7 @@ void Client::destroyClient() destroyDecoration(); cleanGrouping(); if( clientGroup() ) - clientGroup()->remove( this ); + clientGroup()->remove( this, QRect(), true ); workspace()->removeClient( this, Allowed ); client = None; // invalidate XDestroyWindow( display(), wrapper ); diff --git a/clientgroup.cpp b/clientgroup.cpp index b4f083ea72..00d2d5ffac 100644 --- a/clientgroup.cpp +++ b/clientgroup.cpp @@ -97,12 +97,12 @@ void ClientGroup::add( Client* c, int before, bool becomeVisible ) clients_[visible_]->triggerDecorationRepaint(); } -void ClientGroup::remove( int index, const QRect& newGeom ) +void ClientGroup::remove( int index, const QRect& newGeom, bool toNullGroup ) { - remove( clients_[index], newGeom ); + remove( clients_[index], newGeom, toNullGroup ); } -void ClientGroup::remove( Client* c, const QRect& newGeom ) +void ClientGroup::remove( Client* c, const QRect& newGeom, bool toNullGroup ) { if( !c ) return; @@ -130,7 +130,7 @@ void ClientGroup::remove( Client* c, const QRect& newGeom ) updateItems(); updateMinMaxSize(); - c->setClientGroup( new ClientGroup( c )); + c->setClientGroup( toNullGroup ? NULL : new ClientGroup( c )); if( newGeom.isValid() ) c->setGeometry( newGeom ); diff --git a/clientgroup.h b/clientgroup.h index b65255c3c0..dd98006401 100644 --- a/clientgroup.h +++ b/clientgroup.h @@ -62,14 +62,16 @@ class ClientGroup /** * Remove the client at index \p index from the group. If \p newGeom is set then the client * will move and resize to the specified geometry, otherwise it will stay where the group - * is located. + * is located. If \p toNullGroup is not true then the client will be added to a new group + * of its own. */ - void remove( int index, const QRect& newGeom = QRect() ); + void remove( int index, const QRect& newGeom = QRect(), bool toNullGroup = false ); /** * Remove \p c from the group. If \p newGeom is set then the client will move and resize to - * the specified geometry, otherwise it will stay where the group is located. + * the specified geometry, otherwise it will stay where the group is located. If + * \p toNullGroup is not true then the client will be added to a new group of its own. */ - void remove( Client* c, const QRect& newGeom = QRect() ); + void remove( Client* c, const QRect& newGeom = QRect(), bool toNullGroup = false ); /** * Remove all clients from this group. Results in all clients except the first being moved to a group of their own.