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
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);
}
}