From e654c9d106dcc9af96ab761404f5a7eacfa40287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 8 Jan 2013 09:19:13 +0100 Subject: [PATCH] Do not clip away shadows in SlidingPopupsEffect Animation now completely based on the expandedGeometry which includes the shadows and another repaint at the end of the animation is added to ensure that there are no leftover shadows. BUG: 312168 FIXED-IN: 4.10 REVIEW: 108255 --- effects/slidingpopups/slidingpopups.cpp | 35 ++++++++++++++----------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 8ffad4d589..81e5eabe31 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -102,6 +102,7 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DELETE); } else { delete mDisappearingWindows.take(w); + w->addRepaintFull(); w->unrefWindow(); } } @@ -109,10 +110,11 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da const int start = mWindowsData[ w ].start; if (start != 0) { const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), effects->currentDesktop()); + const QRect geo = w->expandedGeometry(); // filter out window quads, but only if the window does not start from the edge switch(mWindowsData[ w ].from) { case West: { - const double splitPoint = w->width() - (w->x() + w->width() - screenRect.x() - start) + w->width() * (appearing ? 1.0 - progress : progress); + const double splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - start) + geo.width() * (appearing ? 1.0 - progress : progress); data.quads = data.quads.splitAtX(splitPoint); WindowQuadList filtered; foreach (const WindowQuad &quad, data.quads) { @@ -124,7 +126,7 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da break; } case North: { - const double splitPoint = w->height() - (w->y() + w->height() - screenRect.y() - start) + w->height() * (appearing ? 1.0 - progress : progress); + const double splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - start) + geo.height() * (appearing ? 1.0 - progress : progress); data.quads = data.quads.splitAtY(splitPoint); WindowQuadList filtered; foreach (const WindowQuad &quad, data.quads) { @@ -136,7 +138,7 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da break; } case East: { - const double splitPoint = screenRect.x() + screenRect.width() - w->x() - start - w->width() * (appearing ? 1.0 - progress : progress); + const double splitPoint = screenRect.x() + screenRect.width() - geo.x() - start - geo.width() * (appearing ? 1.0 - progress : progress); data.quads = data.quads.splitAtX(splitPoint); WindowQuadList filtered; foreach (const WindowQuad &quad, data.quads) { @@ -149,7 +151,7 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da } case South: default: { - const double splitPoint = screenRect.y() + screenRect.height() - w->y() - start - w->height() * (appearing ? 1.0 - progress : progress); + const double splitPoint = screenRect.y() + screenRect.height() - geo.y() - start - geo.height() * (appearing ? 1.0 - progress : progress); data.quads = data.quads.splitAtY(splitPoint); WindowQuadList filtered; foreach (const WindowQuad &quad, data.quads) { @@ -193,27 +195,28 @@ void SlidingPopupsEffect::paintWindow(EffectWindow* w, int mask, QRegion region, const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), w->desktop()); int splitPoint = 0; + const QRect geo = w->expandedGeometry(); switch(mWindowsData[ w ].from) { case West: - data.translate(- w->width() * progress); - splitPoint = w->width() - (w->x() + w->width() - screenRect.x() - start); - region = QRegion(w->x() + splitPoint, w->y(), w->width() - splitPoint, w->height()); + data.translate(- geo.width() * progress); + splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - start); + region = QRegion(geo.x() + splitPoint, geo.y(), geo.width() - splitPoint, geo.height()); break; case North: - data.translate(0.0, - w->height() * progress); - splitPoint = w->height() - (w->y() + w->height() - screenRect.y() - start); - region = QRegion(w->x(), w->y() + splitPoint, w->width(), w->height() - splitPoint); + data.translate(0.0, - geo.height() * progress); + splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - start); + region = QRegion(geo.x(), geo.y() + splitPoint, geo.width(), geo.height() - splitPoint); break; case East: - data.translate(w->width() * progress); - splitPoint = screenRect.x() + screenRect.width() - w->x() - start; - region = QRegion(w->x(), w->y(), splitPoint, w->height()); + data.translate(geo.width() * progress); + splitPoint = screenRect.x() + screenRect.width() - geo.x() - start; + region = QRegion(geo.x(), geo.y(), splitPoint, geo.height()); break; case South: default: - data.translate(0.0, w->height() * progress); - splitPoint = screenRect.y() + screenRect.height() - w->y() - start; - region = QRegion(w->x(), w->y(), w->width(), splitPoint); + data.translate(0.0, geo.height() * progress); + splitPoint = screenRect.y() + screenRect.height() - geo.y() - start; + region = QRegion(geo.x(), geo.y(), geo.width(), splitPoint); } }