From a5d8b15573e06e42876bff200e0c3358dfbd0e01 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 22 Apr 2009 11:24:19 +0000 Subject: [PATCH] bahave better if the user moves the window while changing the stacking order svn path=/trunk/KDE/kdebase/workspace/; revision=957532 --- effects/slideback/slideback.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/effects/slideback/slideback.cpp b/effects/slideback/slideback.cpp index 5b08972e46..24a14422fe 100644 --- a/effects/slideback/slideback.cpp +++ b/effects/slideback/slideback.cpp @@ -228,11 +228,14 @@ void SlideBackEffect::postPaintWindow( EffectWindow* w ) // restore the stacking order of all windows not intersecting any more except panels if( coveringWindows.contains( w ) ) { + EffectWindowList tmpList; foreach( EffectWindow *tmp, elevatedList ) { - if( coveringWindows.contains( tmp ) ) + if( effects->activeWindow() && effects->activeWindow()->geometry().intersects( tmp->geometry() ) ) { QRect newDestination = getSlideDestination( effects->activeWindow()->geometry(), tmp->geometry() ); + if( !motionManager.isManaging( tmp ) ) + motionManager.manage( tmp ); motionManager.moveWindow( tmp, newDestination ); destinationList[tmp] = newDestination; } @@ -240,10 +243,22 @@ void SlideBackEffect::postPaintWindow( EffectWindow* w ) { if( !tmp->isDock() ) { - effects->setElevatedWindow( tmp, false ); - elevatedList.removeAll( tmp ); + bool keepElevated = false; + foreach( EffectWindow *elevatedWindow, tmpList) + { + if( tmp->geometry().intersects( elevatedWindow->geometry() ) ) + { + keepElevated = true; + } + } + if( !keepElevated ) + { + effects->setElevatedWindow( tmp, false ); + elevatedList.removeAll( tmp ); + } } } + tmpList.append(tmp); } } else