diff --git a/client.cpp b/client.cpp index fa72b52698..9f99937737 100644 --- a/client.cpp +++ b/client.cpp @@ -239,6 +239,7 @@ void Client::releaseWindow( bool on_shutdown ) del->unrefWindow(); deleteClient( this, Allowed ); ungrabXServer(); + checkNonExistentClients(); } // like releaseWindow(), but this one is called when the window has been already destroyed @@ -277,6 +278,7 @@ void Client::destroyClient() disownDataPassedToDeleted(); del->unrefWindow(); deleteClient( this, Allowed ); + checkNonExistentClients(); } void Client::updateDecoration( bool check_workspace_pos, bool force ) diff --git a/group.cpp b/group.cpp index 9b6f76aa48..031744d608 100644 --- a/group.cpp +++ b/group.cpp @@ -49,6 +49,8 @@ namespace KWin #endif #ifdef ENABLE_TRANSIENCY_CHECK +static bool transiencyCheckNonExistent = false; + bool performTransiencyCheck() { bool ret = true; @@ -74,7 +76,8 @@ bool performTransiencyCheck() it2 != mains.end(); ++it2 ) { - if( !Workspace::self()->clients.contains( *it2 ) + if( transiencyCheckNonExistent + && !Workspace::self()->clients.contains( *it2 ) && !Workspace::self()->desktops.contains( *it2 )) { kDebug() << "TC:" << *it1 << " has non-existent main client " << endl; @@ -94,7 +97,8 @@ bool performTransiencyCheck() it2 != trans.end(); ++it2 ) { - if( !Workspace::self()->clients.contains( *it2 ) + if( transiencyCheckNonExistent + && !Workspace::self()->clients.contains( *it2 ) && !Workspace::self()->desktops.contains( *it2 )) { kDebug() << "TC:" << *it1 << " has non-existent transient " << endl; @@ -115,13 +119,16 @@ bool performTransiencyCheck() static QString transiencyCheckStartBt; static const Client* transiencyCheckClient; static int transiencyCheck = 0; -static void startTransiencyCheck( const QString& bt, const Client* c ) + +static void startTransiencyCheck( const QString& bt, const Client* c, bool ne ) { if( ++transiencyCheck == 1 ) { transiencyCheckStartBt = bt; transiencyCheckClient = c; } + if( ne ) + transiencyCheckNonExistent = true; } static void checkTransiency() { @@ -133,21 +140,32 @@ static void checkTransiency() kdDebug() << "CLIENT:" << transiencyCheckClient << endl; assert( false ); } + transiencyCheckNonExistent = false; } } class TransiencyChecker { public: - TransiencyChecker( const QString& bt, const Client*c ) { startTransiencyCheck( bt, c ); } + TransiencyChecker( const QString& bt, const Client*c ) { startTransiencyCheck( bt, c, false ); } ~TransiencyChecker() { checkTransiency(); } }; +void checkNonExistentClients() + { + startTransiencyCheck( kdBacktrace(), NULL, true ); + checkTransiency(); + } + #define TRANSIENCY_CHECK( c ) TransiencyChecker transiency_checker( kdBacktrace(), c ) #else #define TRANSIENCY_CHECK( c ) +void checkNonExistentClients() + { + } + #endif //******************************************** diff --git a/utils.h b/utils.h index 981b4202c1..98e7f285bc 100644 --- a/utils.h +++ b/utils.h @@ -325,6 +325,8 @@ int qtToX11State( Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ); Qt::MouseButtons x11ToQtMouseButtons( int state ); Qt::KeyboardModifiers x11ToQtKeyboardModifiers( int state ); +void checkNonExistentClients(); + #ifndef KCMRULES // Qt dialogs emit no signal when closed :( diff --git a/workspace.cpp b/workspace.cpp index 2b3701dfc4..afeb3cdfb5 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -561,6 +561,7 @@ void Workspace::addClient( Client* c, allowed_t ) updateStackingOrder( true ); // propagate new client if( c->isUtility() || c->isMenu() || c->isToolbar()) updateToolWindows( true ); + checkNonExistentClients(); if( tab_grab ) tab_box->reset( true ); }