Add clients to a NULL group when they are released if they were in a

group before.

svn path=/trunk/KDE/kdebase/workspace/; revision=1049887
This commit is contained in:
Lucas Murray 2009-11-16 02:39:16 +00:00
parent 026d0a9839
commit fad5724f33
3 changed files with 12 additions and 10 deletions

View file

@ -246,7 +246,7 @@ void Client::releaseWindow( bool on_shutdown )
destroyDecoration(); destroyDecoration();
cleanGrouping(); cleanGrouping();
if( clientGroup() ) if( clientGroup() )
clientGroup()->remove( this ); clientGroup()->remove( this, QRect(), true );
if( !on_shutdown ) if( !on_shutdown )
{ {
workspace()->removeClient( this, Allowed ); workspace()->removeClient( this, Allowed );
@ -310,7 +310,7 @@ void Client::destroyClient()
destroyDecoration(); destroyDecoration();
cleanGrouping(); cleanGrouping();
if( clientGroup() ) if( clientGroup() )
clientGroup()->remove( this ); clientGroup()->remove( this, QRect(), true );
workspace()->removeClient( this, Allowed ); workspace()->removeClient( this, Allowed );
client = None; // invalidate client = None; // invalidate
XDestroyWindow( display(), wrapper ); XDestroyWindow( display(), wrapper );

View file

@ -97,12 +97,12 @@ void ClientGroup::add( Client* c, int before, bool becomeVisible )
clients_[visible_]->triggerDecorationRepaint(); 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 ) if( !c )
return; return;
@ -130,7 +130,7 @@ void ClientGroup::remove( Client* c, const QRect& newGeom )
updateItems(); updateItems();
updateMinMaxSize(); updateMinMaxSize();
c->setClientGroup( new ClientGroup( c )); c->setClientGroup( toNullGroup ? NULL : new ClientGroup( c ));
if( newGeom.isValid() ) if( newGeom.isValid() )
c->setGeometry( newGeom ); c->setGeometry( newGeom );

View file

@ -62,14 +62,16 @@ class ClientGroup
/** /**
* Remove the client at index \p index from the group. If \p newGeom is set then the client * 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 * 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 * 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 * Remove all clients from this group. Results in all clients except the first being moved
to a group of their own. to a group of their own.