From 520f3e27ac09f3512d4de2bc90c50ed76d5ddcb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sun, 15 Apr 2007 22:01:16 +0000 Subject: [PATCH] Rearrange also when the number of presented windows changes. svn path=/branches/work/kwin_composite/; revision=654365 --- effects/presentwindows.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/effects/presentwindows.cpp b/effects/presentwindows.cpp index e6fde347da..75395cace9 100644 --- a/effects/presentwindows.cpp +++ b/effects/presentwindows.cpp @@ -355,16 +355,20 @@ void PresentWindowsEffect::rearrangeWindows() if( !mWindowData.isEmpty()) // this is not the first arranging { - bool canrearrange = canRearrangeClosest( windowlist ); + bool rearrange = canRearrangeClosest( windowlist ); // called before manipulating mWindowData DataHash newdata; + EffectWindowList newlist = windowlist; + EffectWindowList oldlist = mWindowData.keys(); + qSort( newlist ); + qSort( oldlist ); for( DataHash::ConstIterator it = mWindowData.begin(); it != mWindowData.end(); ++it ) if( windowlist.contains( it.key())) // remove windows that are not in the window list newdata[ it.key() ] = *it; mWindowData = newdata; - if( !canrearrange ) // canRearrange was called before adjusting the list, so that - return; // changes can be detected + if( !rearrange && newlist == oldlist ) + return; for( DataHash::Iterator it = mWindowData.begin(); it != mWindowData.end(); ++it )