summaryrefslogtreecommitdiff
path: root/src/managers/animation/DesktopAnimationManager.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-03-20 13:52:37 -0400
committerGitHub <noreply@github.com>2026-03-20 17:52:37 +0000
commit8726a7363eb9213235e6e23657668e0daac39a5b (patch)
tree42eeb40f6f81a9ccec1455f308e56173e9dcce4b /src/managers/animation/DesktopAnimationManager.cpp
parentb940b0d2c197841b0f648598ee782dbaf9e0a89b (diff)
config: cleanup the entire config infrastructure (#13785)
Massively refactors the config infrastructure, sorely needed and will be req'd for the lua stuff
Diffstat (limited to 'src/managers/animation/DesktopAnimationManager.cpp')
-rw-r--r--src/managers/animation/DesktopAnimationManager.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/managers/animation/DesktopAnimationManager.cpp b/src/managers/animation/DesktopAnimationManager.cpp
index 224fc52f..30961409 100644
--- a/src/managers/animation/DesktopAnimationManager.cpp
+++ b/src/managers/animation/DesktopAnimationManager.cpp
@@ -8,11 +8,17 @@
#include "../../desktop/view/Group.hpp"
#include "../../desktop/Workspace.hpp"
-#include "../../config/ConfigManager.hpp"
+#include "../../config/shared/animation/AnimationTree.hpp"
+
+#include "../../helpers/Monitor.hpp"
#include "../../Compositor.hpp"
#include "desktop/DesktopTypes.hpp"
#include "wlr-layer-shell-unstable-v1.hpp"
+#include <hyprutils/string/VarList.hpp>
+
+using namespace Hyprutils::String;
+
void CDesktopAnimationManager::startAnimation(PHLWINDOW pWindow, eAnimationType type, bool force) {
const bool CLOSE = type == ANIMATION_TYPE_OUT;
@@ -24,13 +30,13 @@ void CDesktopAnimationManager::startAnimation(PHLWINDOW pWindow, eAnimationType
}
if (!CLOSE) {
- pWindow->m_realPosition->setConfig(g_pConfigManager->getAnimationPropertyConfig("windowsIn"));
- pWindow->m_realSize->setConfig(g_pConfigManager->getAnimationPropertyConfig("windowsIn"));
- pWindow->m_alpha->setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeIn"));
+ pWindow->m_realPosition->setConfig(Config::animationTree()->getAnimationPropertyConfig("windowsIn"));
+ pWindow->m_realSize->setConfig(Config::animationTree()->getAnimationPropertyConfig("windowsIn"));
+ pWindow->m_alpha->setConfig(Config::animationTree()->getAnimationPropertyConfig("fadeIn"));
} else {
- pWindow->m_realPosition->setConfig(g_pConfigManager->getAnimationPropertyConfig("windowsOut"));
- pWindow->m_realSize->setConfig(g_pConfigManager->getAnimationPropertyConfig("windowsOut"));
- pWindow->m_alpha->setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeOut"));
+ pWindow->m_realPosition->setConfig(Config::animationTree()->getAnimationPropertyConfig("windowsOut"));
+ pWindow->m_realSize->setConfig(Config::animationTree()->getAnimationPropertyConfig("windowsOut"));
+ pWindow->m_alpha->setConfig(Config::animationTree()->getAnimationPropertyConfig("fadeOut"));
}
std::string ANIMSTYLE = pWindow->m_realPosition->getStyle();
@@ -102,13 +108,13 @@ void CDesktopAnimationManager::startAnimation(PHLLS ls, eAnimationType type, boo
*ls->m_alpha = 0.F;
if (IN) {
- ls->m_realPosition->setConfig(g_pConfigManager->getAnimationPropertyConfig("layersIn"));
- ls->m_realSize->setConfig(g_pConfigManager->getAnimationPropertyConfig("layersIn"));
- ls->m_alpha->setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeLayersIn"));
+ ls->m_realPosition->setConfig(Config::animationTree()->getAnimationPropertyConfig("layersIn"));
+ ls->m_realSize->setConfig(Config::animationTree()->getAnimationPropertyConfig("layersIn"));
+ ls->m_alpha->setConfig(Config::animationTree()->getAnimationPropertyConfig("fadeLayersIn"));
} else {
- ls->m_realPosition->setConfig(g_pConfigManager->getAnimationPropertyConfig("layersOut"));
- ls->m_realSize->setConfig(g_pConfigManager->getAnimationPropertyConfig("layersOut"));
- ls->m_alpha->setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeLayersOut"));
+ ls->m_realPosition->setConfig(Config::animationTree()->getAnimationPropertyConfig("layersOut"));
+ ls->m_realSize->setConfig(Config::animationTree()->getAnimationPropertyConfig("layersOut"));
+ ls->m_alpha->setConfig(Config::animationTree()->getAnimationPropertyConfig("fadeLayersOut"));
}
const auto ANIMSTYLE = ls->m_ruleApplicator->animationStyle().valueOr(ls->m_realPosition->getStyle());
@@ -239,8 +245,8 @@ void CDesktopAnimationManager::startAnimation(PHLWORKSPACE ws, eAnimationType ty
if (!instant) {
const std::string ANIMNAME = std::format("{}{}", ws->m_isSpecialWorkspace ? "specialWorkspace" : "workspaces", IN ? "In" : "Out");
- ws->m_alpha->setConfig(g_pConfigManager->getAnimationPropertyConfig(ANIMNAME));
- ws->m_renderOffset->setConfig(g_pConfigManager->getAnimationPropertyConfig(ANIMNAME));
+ ws->m_alpha->setConfig(Config::animationTree()->getAnimationPropertyConfig(ANIMNAME));
+ ws->m_renderOffset->setConfig(Config::animationTree()->getAnimationPropertyConfig(ANIMNAME));
}
static auto PWORKSPACEGAP = CConfigValue<Hyprlang::INT>("general:gaps_workspaces");
const auto PMONITOR = ws->m_monitor.lock();