From 934adb0b5322c12e435910affb527610dc95ef92 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler Date: Thu, 27 Nov 2025 17:51:18 +0100 Subject: [PATCH 1/2] animation: move PHLANIMVAR from SP to UP --- src/core/AnimatedVariable.hpp | 2 +- src/core/AnimationManager.cpp | 3 +-- src/core/AnimationManager.hpp | 8 +++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/core/AnimatedVariable.hpp b/src/core/AnimatedVariable.hpp index 20dd844..3aeda09 100644 --- a/src/core/AnimatedVariable.hpp +++ b/src/core/AnimatedVariable.hpp @@ -63,7 +63,7 @@ namespace Hyprtoolkit { using CAnimatedVariable = Hyprutils::Animation::CGenericAnimatedVariable; template - using PHLANIMVAR = SP>; + using PHLANIMVAR = UP>; template using PHLANIMVARREF = WP>; diff --git a/src/core/AnimationManager.cpp b/src/core/AnimationManager.cpp index 34132b6..fc7b72b 100644 --- a/src/core/AnimationManager.cpp +++ b/src/core/AnimationManager.cpp @@ -86,8 +86,7 @@ static void updateColorVariable(CAnimatedVariable& av, const float P // } void CHTAnimationManager::tick() { - for (size_t i = 0; i < m_vActiveAnimatedVariables.size(); i++) { - const auto PAV = m_vActiveAnimatedVariables[i].lock(); + for (const auto& PAV : m_vActiveAnimatedVariables) { if (!PAV || !PAV->ok()) continue; diff --git a/src/core/AnimationManager.hpp b/src/core/AnimationManager.hpp index e21e19c..35f2439 100644 --- a/src/core/AnimationManager.hpp +++ b/src/core/AnimationManager.hpp @@ -19,12 +19,10 @@ namespace Hyprtoolkit { template void createAnimation(const VarType& v, PHLANIMVAR& pav, SP pConfig) { constexpr const eAnimatedVarType EAVTYPE = typeToeAnimatedVarType; - const auto PAV = makeShared>(); + pav = makeUnique>(); - PAV->create(EAVTYPE, static_cast(this), PAV, v); - PAV->setConfig(pConfig); - - pav = std::move(PAV); + pav->create(EAVTYPE, static_cast(this), pav, v); + pav->setConfig(pConfig); } Hyprutils::Animation::CAnimationConfigTree m_animationTree; From 2d8b8ee50f9fd2783dedc9c38d818c95c4ff6e48 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler Date: Fri, 28 Nov 2025 08:53:06 +0100 Subject: [PATCH 2/2] use create2 --- src/core/AnimationManager.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/AnimationManager.hpp b/src/core/AnimationManager.hpp index 35f2439..9aec4cf 100644 --- a/src/core/AnimationManager.hpp +++ b/src/core/AnimationManager.hpp @@ -21,7 +21,7 @@ namespace Hyprtoolkit { constexpr const eAnimatedVarType EAVTYPE = typeToeAnimatedVarType; pav = makeUnique>(); - pav->create(EAVTYPE, static_cast(this), pav, v); + pav->create2(EAVTYPE, static_cast(this), pav, v); pav->setConfig(pConfig); }