From 76eae77b5723a0f239a8bc45e574c7672dabff25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 6 Apr 2007 14:51:55 +0000 Subject: [PATCH] Position fixes. svn path=/branches/work/kwin_composite/; revision=651101 --- effects/desktopchangeslide.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/effects/desktopchangeslide.cpp b/effects/desktopchangeslide.cpp index 334a28232e..6b09c423b0 100644 --- a/effects/desktopchangeslide.cpp +++ b/effects/desktopchangeslide.cpp @@ -105,7 +105,7 @@ void DesktopChangeSlideEffect::paintScreen( int mask, QRegion region, ScreenPain { painting_desktop = desktop; painting_sticky = do_sticky; - painting_diff = QPoint( currentPos - desktopRect.topLeft()); + painting_diff = desktopRect.topLeft() - currentPos; if( options->rollOverDesktops ) { if( painting_diff.x() > displayWidth()) @@ -119,8 +119,8 @@ void DesktopChangeSlideEffect::paintScreen( int mask, QRegion region, ScreenPain } do_sticky = false; // paint on-all-desktop windows only once ScreenPaintData d = data; - d.xTranslate -= painting_diff.x(); - d.yTranslate -= painting_diff.y(); + d.xTranslate += painting_diff.x(); + d.yTranslate += painting_diff.y(); // TODO mask parts that are not visible? effects->paintScreen( mask, region, d ); } @@ -133,8 +133,8 @@ void DesktopChangeSlideEffect::paintWindow( EffectWindow* w, int mask, QRegion r { // don't move windows on all desktops (compensate screen transformation) if( w->isOnAllDesktops()) // TODO also fix 'Workspace::movingClient' { - data.xTranslate += painting_diff.x(); - data.yTranslate += painting_diff.y(); + data.xTranslate -= painting_diff.x(); + data.yTranslate -= painting_diff.y(); } } effects->paintWindow( w, mask, region, data ); @@ -204,8 +204,9 @@ void DesktopChangeSlideEffect::desktopChanged( int old ) } else // current position is not on current desktop, do full progress progress = 0; - diffPos = ( currentPos - desktopRect.topLeft()); - startPos = desktopRect.topLeft() + diffPos / ( MAX_PROGRESS - progress ) * MAX_PROGRESS; + diffPos = desktopRect.topLeft() - currentPos; + // Compute starting point for this new move (given current and end positions) + startPos = desktopRect.topLeft() - diffPos * MAX_PROGRESS / ( MAX_PROGRESS - progress ); } else {