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:
parent
5ccd4f2db8
commit
e654c9d106
1 changed files with 19 additions and 16 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue