From 5edc32930d85f5f481160b938965c8bc329487e7 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 30 Apr 2024 02:41:27 +0100 Subject: layerSurface: refactor/move to a memory-safe impl Makes all the pointers smart to avoid memory issues Refactors layerSurface code to live inside desktop/layersurface --- src/managers/AnimationManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/managers/AnimationManager.cpp') diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index 54bdc524..c39df580 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -4,6 +4,7 @@ #include "macros.hpp" #include "../config/ConfigValue.hpp" #include "../desktop/Window.hpp" +#include "../desktop/LayerSurface.hpp" #include "eventLoop/EventLoopManager.hpp" int wlTick(std::shared_ptr self, void* data) { @@ -82,7 +83,7 @@ void CAnimationManager::tick() { // window stuff PHLWINDOW PWINDOW = av->m_pWindow.lock(); PHLWORKSPACE PWORKSPACE = av->m_pWorkspace.lock(); - const auto PLAYER = (SLayerSurface*)av->m_pLayer; + PHLLS PLAYER = av->m_pLayer.lock(); CMonitor* PMONITOR = nullptr; bool animationsDisabled = animGlobalDisabled; @@ -141,7 +142,7 @@ void CAnimationManager::tick() { expandBox.expand(5); g_pHyprRenderer->damageBox(&expandBox); - PMONITOR = g_pCompositor->getMonitorFromVector(Vector2D(PLAYER->geometry.x, PLAYER->geometry.y) + Vector2D(PLAYER->geometry.width, PLAYER->geometry.height) / 2.f); + PMONITOR = g_pCompositor->getMonitorFromVector(PLAYER->realPosition.goal() + PLAYER->realSize.goal() / 2.F); if (!PMONITOR) continue; animationsDisabled = animationsDisabled || PLAYER->noAnimations; -- cgit v1.2.3