Correctly check forcebackgroundcontrastrule
Summary: WindowBackgroundContrastRole property is a bool or undefined. QVariant::isValid() returns true for QVariant(false) which is not what we want for this code. toBool on an invalid QVariant will return false. Test Plan: NA. Was based on code review. To get a bug you'd have to PresentWindows/Slide effect manipulate a sliding popup, which AFAIK doesn't happen. Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D13478
This commit is contained in:
parent
5b4eb80c8f
commit
1193e3c369
1 changed files with 2 additions and 2 deletions
|
@ -302,7 +302,7 @@ void SlidingPopupsEffect::slotWindowAdded(EffectWindow *w)
|
|||
void SlidingPopupsEffect::startForShow(EffectWindow *w)
|
||||
{
|
||||
if (w->isOnCurrentDesktop() && mWindowsData.contains(w)) {
|
||||
if (!w->data(WindowForceBackgroundContrastRole).isValid() && w->hasAlpha()) {
|
||||
if (!w->data(WindowForceBackgroundContrastRole).toBool() && w->hasAlpha()) {
|
||||
w->setData(WindowForceBackgroundContrastRole, QVariant(true));
|
||||
m_backgroundContrastForced.append(w);
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ void SlidingPopupsEffect::slotWindowClosed(EffectWindow* w)
|
|||
// Tell other windowClosed() effects to ignore this window
|
||||
w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast<void*>(this)));
|
||||
w->setData(WindowForceBlurRole, true);
|
||||
if (!w->data(WindowForceBackgroundContrastRole).isValid() && w->hasAlpha()) {
|
||||
if (!w->data(WindowForceBackgroundContrastRole).toBool() && w->hasAlpha()) {
|
||||
w->setData(WindowForceBackgroundContrastRole, QVariant(true));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue