diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 4f0a9ea11d..99c3bfe732 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -85,6 +85,11 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da } else { delete mAppearingWindows.take(w); w->setData(WindowForceBlurRole, false); + if (m_backgroundContrastForced.contains(w) && w->hasAlpha() && + w->data(WindowForceBackgroundContrastRole).toBool()) { + w->setData(WindowForceBackgroundContrastRole, QVariant()); + m_backgroundContrastForced.removeAll(w); + } } } else if (mDisappearingWindows.contains(w)) { @@ -255,6 +260,10 @@ void SlidingPopupsEffect::slotWindowAdded(EffectWindow *w) { slotPropertyNotify(w, mAtom); if (w->isOnCurrentDesktop() && mWindowsData.contains(w)) { + if (!w->data(WindowForceBackgroundContrastRole).isValid() && w->hasAlpha()) { + w->setData(WindowForceBackgroundContrastRole, QVariant(true)); + m_backgroundContrastForced.append(w); + } mAppearingWindows.insert(w, new QTimeLine(mWindowsData[ w ].fadeInDuration, this)); mAppearingWindows[ w ]->setCurveShape(QTimeLine::EaseInOutCurve); @@ -278,9 +287,13 @@ 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); + if (!w->data(WindowForceBackgroundContrastRole).isValid() && w->hasAlpha()) { + w->setData(WindowForceBackgroundContrastRole, QVariant(true)); + } w->addRepaintFull(); } + m_backgroundContrastForced.removeAll(w); } void SlidingPopupsEffect::slotWindowDeleted(EffectWindow* w) diff --git a/effects/slidingpopups/slidingpopups.h b/effects/slidingpopups/slidingpopups.h index f66e42ec42..77f0103b49 100644 --- a/effects/slidingpopups/slidingpopups.h +++ b/effects/slidingpopups/slidingpopups.h @@ -74,6 +74,11 @@ private: int slideLength; }; long mAtom; + + // This list is only for appearing windows: we remember that we've enabled the + // WindowBackgroundContrastForcedRole flag, so we can remove it later. + // It doesn't matter for disappearing windows, they'll be deleted anyway. + QList< const EffectWindow* > m_backgroundContrastForced; QHash< const EffectWindow*, QTimeLine* > mAppearingWindows; QHash< const EffectWindow*, QTimeLine* > mDisappearingWindows; QHash< const EffectWindow*, Data > mWindowsData;