Commit 80b9617b authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Merge Service
Browse files

effects/fallapart: Fix glitch

The WindowItem visibility reference must be dropped after, not before
starting painting. It also makes the fall apart effect code consistent
with other effects.

BUG: 454243
Tested-by: Merge Service <!2455>
Part-of: <!2455>
parent cfd3676e
Pipeline #180345 passed with stage
in 36 minutes and 58 seconds
......@@ -50,19 +50,14 @@ void FallApartEffect::prePaintWindow(EffectWindow *w, WindowPrePaintData &data,
{
auto animationIt = windows.find(w);
if (animationIt != windows.end() && isRealWindow(w)) {
if (animationIt->progress < 1) {
int time = 0;
if (animationIt->lastPresentTime.count()) {
time = (presentTime - animationIt->lastPresentTime).count();
}
animationIt->lastPresentTime = presentTime;
animationIt->progress += time / animationTime(1000.);
data.setTransformed();
} else {
unredirect(w);
windows.remove(w);
int time = 0;
if (animationIt->lastPresentTime.count()) {
time = (presentTime - animationIt->lastPresentTime).count();
}
animationIt->lastPresentTime = presentTime;
animationIt->progress += time / animationTime(1000.);
data.setTransformed();
}
effects->prePaintWindow(w, data, presentTime);
}
......@@ -128,9 +123,16 @@ void FallApartEffect::deform(EffectWindow *w, int mask, WindowPaintData &data, W
void FallApartEffect::postPaintScreen()
{
if (!windows.isEmpty()) {
effects->addRepaintFull();
for (auto it = windows.begin(); it != windows.end();) {
if (it->progress < 1) {
++it;
} else {
unredirect(it.key());
it = windows.erase(it);
}
}
effects->addRepaintFull();
effects->postPaintScreen();
}
......
Supports Markdown
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