reduce the number of X-errors. Thanks to Lars Hete for this one.

svn path=/trunk/kdebase/kwin/; revision=86918
This commit is contained in:
Matthias Ettrich 2001-03-14 09:21:16 +00:00
parent 5d5f9149fa
commit 11f1ab2b60
3 changed files with 16 additions and 4 deletions

View file

@ -978,6 +978,8 @@ bool Client::unmapNotify( XUnmapEvent& e )
void Client::withdraw() void Client::withdraw()
{ {
Events::raise( isTransient() ? Events::TransDelete : Events::Delete ); Events::raise( isTransient() ? Events::TransDelete : Events::Delete );
// remove early from client list
workspace()->removeClient( this );
setMappingState( WithdrawnState ); setMappingState( WithdrawnState );
info->setDesktop( 0 ); info->setDesktop( 0 );
desk = 0; desk = 0;

View file

@ -627,6 +627,14 @@ QRect Workspace::geometry() const
} }
} }
void Workspace::removeClient( Client* c) {
clients.remove( c );
stacking_order.remove( c );
focus_chain.remove( c );
propagateClients();
}
/* /*
Destroys the client \a c Destroys the client \a c
*/ */
@ -634,9 +642,10 @@ bool Workspace::destroyClient( Client* c)
{ {
if ( !c ) if ( !c )
return FALSE; return FALSE;
clients.remove( c );
stacking_order.remove( c ); if (clients.contains(c))
focus_chain.remove( c ); removeClient(c);
c->invalidateWindow(); c->invalidateWindow();
clientHidden( c ); clientHidden( c );
if ( c == desktop_client ) if ( c == desktop_client )
@ -651,7 +660,6 @@ bool Workspace::destroyClient( Client* c)
last_active_client = 0; last_active_client = 0;
storeFakeSessionInfo( c ); storeFakeSessionInfo( c );
delete c; delete c;
propagateClients();
updateClientArea(); updateClientArea();
return TRUE; return TRUE;
} }

View file

@ -102,6 +102,8 @@ public:
QRect clientArea(); QRect clientArea();
void removeClient( Client* );
bool destroyClient( Client* ); bool destroyClient( Client* );
void killWindowAtPosition(int x, int y); void killWindowAtPosition(int x, int y);