From d2ae57832b35e4e12c20483833114587d1bed7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Thu, 20 Feb 2014 14:38:36 +0100 Subject: [PATCH] slidingpopups claim windowClosedGrabRole earlier This seems like a more proper fix for the flickering issue in the sliding popups effect. The problem is that slidingpopups grabs the window in windowClosed, the fade effect checks it there, which makes it racy. In my tests, I've not seen this problem with the WindowAddedGrab, but as far as I understand, the problem may well be present there as well. (And my proposed trick doesn't work.) I've not seen this happening in my debugging, however. The problem there is also less visible since the transparency curves go into the same direction, and are more "in line with each other". So, fix: Move the setData(WindowClosedGrabRole, ...) call from windowClosed into windowAdded, which makes sure it's set whenever the window goes away. REVIEW:115903 BUG:329991 --- effects/slidingpopups/slidingpopups.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 99c3bfe732..fb3dd15801 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -267,8 +267,9 @@ void SlidingPopupsEffect::slotWindowAdded(EffectWindow *w) mAppearingWindows.insert(w, new QTimeLine(mWindowsData[ w ].fadeInDuration, this)); mAppearingWindows[ w ]->setCurveShape(QTimeLine::EaseInOutCurve); - // Tell other windowAdded() effects to ignore this window + // Tell other windowAdded() and windowClosed() effects to ignore this window w->setData(WindowAddedGrabRole, QVariant::fromValue(static_cast(this))); + w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast(this))); w->setData(WindowForceBlurRole, true); w->addRepaintFull(); @@ -313,6 +314,7 @@ void SlidingPopupsEffect::slotPropertyNotify(EffectWindow* w, long a) if (data.length() < 1) { // Property was removed, thus also remove the effect for window + w->setData(WindowClosedGrabRole, QVariant()); delete mAppearingWindows.take(w); delete mDisappearingWindows.take(w); mWindowsData.remove(w); @@ -379,6 +381,8 @@ void SlidingPopupsEffect::slotPropertyNotify(EffectWindow* w, long a) } animData.start = qMax(animData.start, difference); mWindowsData[ w ] = animData; + // Grab the window, so other windowClosed effects will ignore it + w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast(this))); } bool SlidingPopupsEffect::isActive() const