[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace] kwin/effects/slidingpopups: slidingpopups claim windowClosedGrabRole earlier
From:       Sebastian_Kügler <sebas () kde ! org>
Date:       2014-02-20 13:39:54
Message-ID: E1WGTr0-00008F-KO () scm ! kde ! org
[Download RAW message or body]

Git commit 0d9582627e055f80c380a8812aa81ba4b9379fc7 by Sebastian Kügler.
Committed on 20/02/2014 at 13:38.
Pushed by sebas into branch 'master'.

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

M  +5    -1    kwin/effects/slidingpopups/slidingpopups.cpp

http://commits.kde.org/kde-workspace/0d9582627e055f80c380a8812aa81ba4b9379fc7

diff --git a/kwin/effects/slidingpopups/slidingpopups.cpp b/kwin/effects/slidingpopups/slidingpopups.cpp
index 99c3bfe..fb3dd15 100644
--- a/kwin/effects/slidingpopups/slidingpopups.cpp
+++ b/kwin/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<void*>(this)));
+        w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast<void*>(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<int>(animData.start, difference);
     mWindowsData[ w ] = animData;
+    // Grab the window, so other windowClosed effects will ignore it
+    w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast<void*>(this)));
 }
 
 bool SlidingPopupsEffect::isActive() const
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic