From 91f0305942c7c11bfa684b0ee03af14bb8e7bcd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 28 Apr 2009 15:26:02 +0000 Subject: [PATCH] Use foreach loop instead of iterator based for loop when walking through stacking_order in cascade desktop. It seems that stacking order is changed which is causing a crash with the iterator based version. BUG: 190903 svn path=/trunk/KDE/kdebase/workspace/; revision=960527 --- geometry.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index df2983cb8d..215cdbf819 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -771,17 +771,16 @@ void Workspace::cascadeDesktop() { // TODO XINERAMA this probably is not right for xinerama Q_ASSERT( block_stacking_updates == 0 ); - ClientList::ConstIterator it(stackingOrder().begin()); initPositioning->reinitCascading( currentDesktop()); QRect area = clientArea( PlacementArea, QPoint( 0, 0 ), currentDesktop()); - for (; it != stackingOrder().end(); ++it) + foreach( Client* client, stackingOrder() ) { - if((!(*it)->isOnDesktop(currentDesktop())) || - ((*it)->isMinimized()) || - ((*it)->isOnAllDesktops()) || - (!(*it)->isMovable()) ) + if((!client->isOnDesktop(currentDesktop())) || + (client->isMinimized()) || + (client->isOnAllDesktops()) || + (!client->isMovable()) ) continue; - initPositioning->placeCascaded(*it, area); + initPositioning->placeCascaded(client, area); } }