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
This commit is contained in:
Martin Gräßlin 2013-01-08 09:19:13 +01:00
parent 5ccd4f2db8
commit e654c9d106

View file

@ -102,6 +102,7 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da
w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DELETE); w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DELETE);
} else { } else {
delete mDisappearingWindows.take(w); delete mDisappearingWindows.take(w);
w->addRepaintFull();
w->unrefWindow(); w->unrefWindow();
} }
} }
@ -109,10 +110,11 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da
const int start = mWindowsData[ w ].start; const int start = mWindowsData[ w ].start;
if (start != 0) { if (start != 0) {
const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), effects->currentDesktop()); 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 // filter out window quads, but only if the window does not start from the edge
switch(mWindowsData[ w ].from) { switch(mWindowsData[ w ].from) {
case West: { 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); data.quads = data.quads.splitAtX(splitPoint);
WindowQuadList filtered; WindowQuadList filtered;
foreach (const WindowQuad &quad, data.quads) { foreach (const WindowQuad &quad, data.quads) {
@ -124,7 +126,7 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da
break; break;
} }
case North: { 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); data.quads = data.quads.splitAtY(splitPoint);
WindowQuadList filtered; WindowQuadList filtered;
foreach (const WindowQuad &quad, data.quads) { foreach (const WindowQuad &quad, data.quads) {
@ -136,7 +138,7 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da
break; break;
} }
case East: { 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); data.quads = data.quads.splitAtX(splitPoint);
WindowQuadList filtered; WindowQuadList filtered;
foreach (const WindowQuad &quad, data.quads) { foreach (const WindowQuad &quad, data.quads) {
@ -149,7 +151,7 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da
} }
case South: case South:
default: { 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); data.quads = data.quads.splitAtY(splitPoint);
WindowQuadList filtered; WindowQuadList filtered;
foreach (const WindowQuad &quad, data.quads) { 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()); const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), w->desktop());
int splitPoint = 0; int splitPoint = 0;
const QRect geo = w->expandedGeometry();
switch(mWindowsData[ w ].from) { switch(mWindowsData[ w ].from) {
case West: case West:
data.translate(- w->width() * progress); data.translate(- geo.width() * progress);
splitPoint = w->width() - (w->x() + w->width() - screenRect.x() - start); splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - start);
region = QRegion(w->x() + splitPoint, w->y(), w->width() - splitPoint, w->height()); region = QRegion(geo.x() + splitPoint, geo.y(), geo.width() - splitPoint, geo.height());
break; break;
case North: case North:
data.translate(0.0, - w->height() * progress); data.translate(0.0, - geo.height() * progress);
splitPoint = w->height() - (w->y() + w->height() - screenRect.y() - start); splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - start);
region = QRegion(w->x(), w->y() + splitPoint, w->width(), w->height() - splitPoint); region = QRegion(geo.x(), geo.y() + splitPoint, geo.width(), geo.height() - splitPoint);
break; break;
case East: case East:
data.translate(w->width() * progress); data.translate(geo.width() * progress);
splitPoint = screenRect.x() + screenRect.width() - w->x() - start; splitPoint = screenRect.x() + screenRect.width() - geo.x() - start;
region = QRegion(w->x(), w->y(), splitPoint, w->height()); region = QRegion(geo.x(), geo.y(), splitPoint, geo.height());
break; break;
case South: case South:
default: default:
data.translate(0.0, w->height() * progress); data.translate(0.0, geo.height() * progress);
splitPoint = screenRect.y() + screenRect.height() - w->y() - start; splitPoint = screenRect.y() + screenRect.height() - geo.y() - start;
region = QRegion(w->x(), w->y(), w->width(), splitPoint); region = QRegion(geo.x(), geo.y(), geo.width(), splitPoint);
} }
} }