Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 82ab1d1e authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[effects/slidingpopups] Unconditionally force background contrast

Summary: Force background contrast same way blur is forced.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14092
parent 3b3aa82f
......@@ -105,12 +105,8 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da
appearing = true;
} else {
mAppearingWindows.remove(w);
w->setData(WindowForceBackgroundContrastRole, false);
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)) {
......@@ -304,11 +300,6 @@ void SlidingPopupsEffect::slotWindowAdded(EffectWindow *w)
void SlidingPopupsEffect::startForShow(EffectWindow *w)
{
if (w->isOnCurrentDesktop() && mWindowsData.contains(w)) {
if (!w->data(WindowForceBackgroundContrastRole).toBool() && w->hasAlpha()) {
w->setData(WindowForceBackgroundContrastRole, QVariant(true));
m_backgroundContrastForced.append(w);
}
mDisappearingWindows.remove(w);
TimeLine &timeLine = mAppearingWindows[ w ];
......@@ -319,6 +310,7 @@ void SlidingPopupsEffect::startForShow(EffectWindow *w)
w->setData(WindowAddedGrabRole, QVariant::fromValue(static_cast<void*>(this)));
w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast<void*>(this)));
w->setData(WindowForceBackgroundContrastRole, true);
w->setData(WindowForceBlurRole, true);
w->addRepaintFull();
......@@ -344,14 +336,11 @@ void SlidingPopupsEffect::slotWindowClosed(EffectWindow* w)
// Tell other windowClosed() effects to ignore this window
w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast<void*>(this)));
w->setData(WindowForceBackgroundContrastRole, true);
w->setData(WindowForceBlurRole, true);
if (!w->data(WindowForceBackgroundContrastRole).toBool() && w->hasAlpha()) {
w->setData(WindowForceBackgroundContrastRole, QVariant(true));
}
w->addRepaintFull();
}
m_backgroundContrastForced.removeAll(w);
}
void SlidingPopupsEffect::slotWindowDeleted(EffectWindow* w)
......
......@@ -84,10 +84,6 @@ private:
};
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*, TimeLine > mAppearingWindows;
QHash< const EffectWindow*, TimeLine > mDisappearingWindows;
QHash< const EffectWindow*, Data > mWindowsData;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment