summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2013-01-08 08:19:13 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2013-01-11 07:50:15 (GMT)
commite448aeb49efb031d93ce3fcefcca9c01fb920697 (patch)
treedc715ba6e00055cfe434fe1f0b8980f855210bdc
parentbfb6a117119444d3b245dd6e1b54d52c591c4554 (diff)
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
-rw-r--r--kwin/effects/slidingpopups/slidingpopups.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/kwin/effects/slidingpopups/slidingpopups.cpp b/kwin/effects/slidingpopups/slidingpopups.cpp
index 8ffad4d..81e5eab 100644
--- a/kwin/effects/slidingpopups/slidingpopups.cpp
+++ b/kwin/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);
}
}