diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-04 15:56:31 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-04 15:56:31 +0000 |
| commit | 206360177fcae23436928542ed860c854b985db4 (patch) | |
| tree | c60b5cd406d79d14ef3dd88bcf615e7c1734e18b /src/managers/AnimationManager.cpp | |
| parent | 34ad837fd93a55c2a234381c9077fba1c2fd154c (diff) | |
Multiple animation optimization and xwayland wine fixes
Diffstat (limited to 'src/managers/AnimationManager.cpp')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index b465a3b5..06fa60da 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -33,6 +33,8 @@ void CAnimationManager::tick() { const auto DEFAULTBEZIER = m_mBezierCurves.find("default"); + std::vector<CAnimatedVariable*> animationEndedVars; + for (auto& av : m_lAnimatedVariables) { // first of all, check if we need to update it at all @@ -225,13 +227,21 @@ void CAnimationManager::tick() { } } - // set size and pos if valid, but only if damage policy entire (dont if border for example) if (g_pCompositor->windowValidMapped(PWINDOW) && av->m_eDamagePolicy == AVARDAMAGE_ENTIRE && PWINDOW->m_iX11Type != 2) g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goalv()); // manually schedule a frame g_pCompositor->scheduleFrameForMonitor(PMONITOR); + + // check if we did not finish animating. If so, trigger onAnimationEnd. + if (!av->isBeingAnimated()) + animationEndedVars.push_back(av); + } + + // do it here, because if this alters the animation vars deque we would be in trouble above. + for (auto& ave : animationEndedVars) { + ave->onAnimationEnd(); } } |
