diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index e050beb62e..b394ff32b0 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -347,7 +347,7 @@ bool BlurEffect::shouldBlur(const EffectWindow *w, int mask, const WindowPaintDa bool scaled = !qFuzzyCompare(data.xScale, 1.0) && !qFuzzyCompare(data.yScale, 1.0); bool translated = data.xTranslate || data.yTranslate; - if (scaled || translated || (mask & PAINT_WINDOW_TRANSFORMED)) + if (scaled || ((translated || (mask & PAINT_WINDOW_TRANSFORMED)) && !w->data(WindowForceBlurRole).toBool())) return false; bool blurBehindDecos = effects->decorationsHaveAlpha() && @@ -363,10 +363,17 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPai { const QRect screen(0, 0, displayWidth(), displayHeight()); if (shouldBlur(w, mask, data)) { - const QRegion shape = region & blurRegion(w).translated(w->pos()) & screen; + QRegion shape = region & blurRegion(w).translated(w->pos()) & screen; + + const bool translated = data.xTranslate || data.yTranslate; + // let's do the evil parts - someone wants to blur behind a transformed window + if (translated) { + shape = shape.translated(data.xTranslate, data.yTranslate); + shape = shape & region; + } if (!shape.isEmpty()) { - if (m_shouldCache) { + if (m_shouldCache && !translated) { doCachedBlur(w, region, data.opacity * data.contents_opacity); } else { doBlur(shape, screen, data.opacity * data.contents_opacity); diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 12730764ea..8fb0608031 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -90,8 +90,10 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da data.setTransformed(); progress = mAppearingWindows[ w ]->currentValue(); appearing = true; - } else + } else { delete mAppearingWindows.take(w); + w->setData(WindowForceBlurRole, false); + } } else if (mDisappearingWindows.contains(w)) { mDisappearingWindows[ w ]->setCurrentTime(mDisappearingWindows[ w ]->currentTime() + time); @@ -192,19 +194,28 @@ void SlidingPopupsEffect::paintWindow(EffectWindow* w, int mask, QRegion region, const int start = mWindowsData[ w ].start; const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), w->desktop()); + int splitPoint = 0; switch(mWindowsData[ w ].from) { case West: data.xTranslate -= 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()); break; case North: data.yTranslate -= 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); break; case East: data.xTranslate += w->width() * progress; + splitPoint = screenRect.x() + screenRect.width() - w->x() - start; + region = QRegion(w->x(), w->y(), splitPoint, w->height()); break; case South: default: data.yTranslate += w->height() * progress; + splitPoint = screenRect.y() + screenRect.height() - w->y() - start; + region = QRegion(w->x(), w->y(), w->width(), splitPoint); } } @@ -228,6 +239,7 @@ void SlidingPopupsEffect::slotWindowAdded(EffectWindow *w) // Tell other windowAdded() effects to ignore this window w->setData(WindowAddedGrabRole, QVariant::fromValue(static_cast(this))); + w->setData(WindowForceBlurRole, true); w->addRepaintFull(); } @@ -244,6 +256,7 @@ void SlidingPopupsEffect::slotWindowClosed(EffectWindow* w) // Tell other windowClosed() effects to ignore this window w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast(this))); + w->setData(WindowForceBlurRole, true); w->addRepaintFull(); }