From 206360177fcae23436928542ed860c854b985db4 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 4 Nov 2022 15:56:31 +0000 Subject: Multiple animation optimization and xwayland wine fixes --- src/managers/AnimationManager.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/managers/AnimationManager.cpp') 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 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(); } } -- cgit v1.2.3