summaryrefslogtreecommitdiff
path: root/src/managers/AnimationManager.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-04-30 02:41:27 +0100
committerVaxry <vaxry@vaxry.net>2024-04-30 02:41:27 +0100
commit5edc32930d85f5f481160b938965c8bc329487e7 (patch)
tree3609cb2bebd1f72e17605022e2b9a2dd526377f6 /src/managers/AnimationManager.cpp
parent5e6f7b1cdb72b394ad8556bb232ac8a406d851b4 (diff)
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
Diffstat (limited to 'src/managers/AnimationManager.cpp')
-rw-r--r--src/managers/AnimationManager.cpp5
1 files changed, 3 insertions, 2 deletions
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<CEventLoopTimer> 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;