animation: migrate PHLANIMVAR from SP to UP (#12486)

This commit is contained in:
Maximilian Seidler 2025-12-14 19:46:49 +00:00 committed by GitHub
parent e4a8f2b14f
commit 7ccc57eb7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 20 deletions

View file

@ -209,8 +209,7 @@ void CHyprAnimationManager::tick() {
static auto PANIMENABLED = CConfigValue<Hyprlang::INT>("animations:enabled");
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)
continue;

View file

@ -22,13 +22,11 @@ class CHyprAnimationManager : public Hyprutils::Animation::CAnimationManager {
template <Animable VarType>
void createAnimation(const VarType& v, PHLANIMVAR<VarType>& pav, SP<SAnimationPropertyConfig> pConfig, eAVarDamagePolicy policy) {
constexpr const eAnimatedVarType EAVTYPE = typeToeAnimatedVarType<VarType>;
const auto PAV = makeShared<CAnimatedVariable<VarType>>();
pav = makeUnique<CAnimatedVariable<VarType>>();
PAV->create(EAVTYPE, sc<Hyprutils::Animation::CAnimationManager*>(this), PAV, v);
PAV->setConfig(pConfig);
PAV->m_Context.eDamagePolicy = policy;
pav = std::move(PAV);
pav->create2(EAVTYPE, sc<Hyprutils::Animation::CAnimationManager*>(this), pav, v);
pav->setConfig(pConfig);
pav->m_Context.eDamagePolicy = policy;
}
template <Animable VarType>