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
This commit is contained in:
Martin Gräßlin 2009-04-28 15:26:02 +00:00
parent 7a06c636b2
commit 91f0305942

View file

@ -771,17 +771,16 @@ void Workspace::cascadeDesktop()
{ {
// TODO XINERAMA this probably is not right for xinerama // TODO XINERAMA this probably is not right for xinerama
Q_ASSERT( block_stacking_updates == 0 ); Q_ASSERT( block_stacking_updates == 0 );
ClientList::ConstIterator it(stackingOrder().begin());
initPositioning->reinitCascading( currentDesktop()); initPositioning->reinitCascading( currentDesktop());
QRect area = clientArea( PlacementArea, QPoint( 0, 0 ), currentDesktop()); QRect area = clientArea( PlacementArea, QPoint( 0, 0 ), currentDesktop());
for (; it != stackingOrder().end(); ++it) foreach( Client* client, stackingOrder() )
{ {
if((!(*it)->isOnDesktop(currentDesktop())) || if((!client->isOnDesktop(currentDesktop())) ||
((*it)->isMinimized()) || (client->isMinimized()) ||
((*it)->isOnAllDesktops()) || (client->isOnAllDesktops()) ||
(!(*it)->isMovable()) ) (!client->isMovable()) )
continue; continue;
initPositioning->placeCascaded(*it, area); initPositioning->placeCascaded(client, area);
} }
} }