From c32d95f0f229c5d6e1e01513cad0822c1bca9a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 23 Mar 2005 14:52:54 +0000 Subject: [PATCH] Since hasTransient() can search bottom-up or top-bottom depending on which is cheaper, make sure to block recursion for the proper client that has been already checked. BUG: 94800 svn path=/trunk/kdebase/kwin/; revision=400008 --- group.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/group.cpp b/group.cpp index df11b7542d..0d47a6a917 100644 --- a/group.cpp +++ b/group.cpp @@ -692,15 +692,15 @@ bool Client::hasTransient( const Client* cl, bool indirect ) const bool Client::hasTransientInternal( const Client* cl, bool indirect, ConstClientList& set ) const { - if( set.contains( this )) - return false; - set.append( this ); if( cl->transientFor() != NULL ) { if( cl->transientFor() == this ) return true; if( !indirect ) return false; + if( set.contains( cl )) + return false; + set.append( cl ); return hasTransientInternal( cl->transientFor(), indirect, set ); } if( !cl->isTransient()) @@ -712,6 +712,9 @@ bool Client::hasTransientInternal( const Client* cl, bool indirect, ConstClientL return true; if( !indirect ) return false; + if( set.contains( this )) + return false; + set.append( this ); for( ClientList::ConstIterator it = transients().begin(); it != transients().end(); ++it )