From e2da7c6b1fceee9358229a3b5ca48127cd2c427c Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Wed, 10 Dec 2025 09:15:39 +0000 Subject: [PATCH] animation: migrate PHLANIMVAR from SP to UP (#920) * animation: migrate PHLANIMVAR from SP to UP * use create2 * bump hyprutils and flake update --- CMakeLists.txt | 2 +- flake.lock | 30 +++++++++++++++--------------- src/core/AnimationManager.cpp | 3 +-- src/core/AnimationManager.hpp | 8 +++----- src/helpers/AnimatedVariable.hpp | 2 +- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50ba622..1ee63ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ pkg_check_modules( pangocairo libdrm gbm - hyprutils>=0.8.0 + hyprutils>=0.11.0 sdbus-c++>=2.0.0 hyprgraphics>=0.1.6) find_library(PAM_FOUND NAMES pam libpam) diff --git a/flake.lock b/flake.lock index bcbf85a..8f6e2c8 100644 --- a/flake.lock +++ b/flake.lock @@ -13,11 +13,11 @@ ] }, "locked": { - "lastModified": 1759490292, - "narHash": "sha256-T6iWzDOXp8Wv0KQOCTHpBcmAOdHJ6zc/l9xaztW6Ivc=", + "lastModified": 1763733840, + "narHash": "sha256-JnET78yl5RvpGuDQy3rCycOCkiKoLr5DN1fPhRNNMco=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "9431db625cd9bb66ac55525479dce694101d6d7a", + "rev": "8f1bec691b2d198c60cccabca7a94add2df4ed1a", "type": "github" }, "original": { @@ -39,11 +39,11 @@ ] }, "locked": { - "lastModified": 1758927902, - "narHash": "sha256-LZgMds7M94+vuMql2bERQ6LiFFdhgsEFezE4Vn+Ys3A=", + "lastModified": 1764612430, + "narHash": "sha256-54ltTSbI6W+qYGMchAgCR6QnC1kOdKXN6X6pJhOWxFg=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "4dafa28d4f79877d67a7d1a654cddccf8ebf15da", + "rev": "0d00dc118981531aa731150b6ea551ef037acddd", "type": "github" }, "original": { @@ -62,11 +62,11 @@ ] }, "locked": { - "lastModified": 1759619523, - "narHash": "sha256-r1ed7AR2ZEb2U8gy321/Xcp1ho2tzn+gG1te/Wxsj1A=", + "lastModified": 1764962281, + "narHash": "sha256-rGbEMhTTyTzw4iyz45lch5kXseqnqcEpmrHdy+zHsfo=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "3df7bde01efb3a3e8e678d1155f2aa3f19e177ef", + "rev": "fe686486ac867a1a24f99c753bb40ffed338e4b0", "type": "github" }, "original": { @@ -85,11 +85,11 @@ ] }, "locked": { - "lastModified": 1755184602, - "narHash": "sha256-RCBQN8xuADB0LEgaKbfRqwm6CdyopE1xIEhNc67FAbw=", + "lastModified": 1763640274, + "narHash": "sha256-Uan1Nl9i4TF/kyFoHnTq1bd/rsWh4GAK/9/jDqLbY5A=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "b3b0f1f40ae09d4447c20608e5a4faf8bf3c492d", + "rev": "f6cf414ca0e16a4d30198fd670ec86df3c89f671", "type": "github" }, "original": { @@ -100,11 +100,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1759831965, - "narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=", + "lastModified": 1765186076, + "narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c9b6fb798541223bbb396d287d16f43520250518", + "rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8", "type": "github" }, "original": { diff --git a/src/core/AnimationManager.cpp b/src/core/AnimationManager.cpp index 49d10b1..42a713a 100644 --- a/src/core/AnimationManager.cpp +++ b/src/core/AnimationManager.cpp @@ -78,8 +78,7 @@ void updateGradientVariable(CAnimatedVariable& av, const flo void CHyprlockAnimationManager::tick() { static const auto ANIMATIONSENABLED = g_pConfigManager->getValue("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 || !PAV->ok()) continue; diff --git a/src/core/AnimationManager.hpp b/src/core/AnimationManager.hpp index e6d01e8..1ba8d86 100644 --- a/src/core/AnimationManager.hpp +++ b/src/core/AnimationManager.hpp @@ -19,12 +19,10 @@ class CHyprlockAnimationManager : public Hyprutils::Animation::CAnimationManager 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->create2(EAVTYPE, static_cast(this), pav, v); + pav->setConfig(pConfig); } bool m_bTickScheduled = false; diff --git a/src/helpers/AnimatedVariable.hpp b/src/helpers/AnimatedVariable.hpp index c48176c..18eb9a3 100644 --- a/src/helpers/AnimatedVariable.hpp +++ b/src/helpers/AnimatedVariable.hpp @@ -61,7 +61,7 @@ template using CAnimatedVariable = Hyprutils::Animation::CGenericAnimatedVariable; template -using PHLANIMVAR = SP>; +using PHLANIMVAR = UP>; template using PHLANIMVARREF = WP>;