diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-04-02 20:32:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-02 20:32:39 +0100 |
| commit | ef23ef60c5641c5903f9cf40571ead7ad6aba1b9 (patch) | |
| tree | 2eece29849bf25d7710edd9cee5d12186a9253fc /src/managers/AnimationManager.cpp | |
| parent | fc0a7af7ba5c52f7a70309020f5cb27c19d068e6 (diff) | |
Workspace/core: Refactor workspace storage (#5380)
* refactor workspaces to use ptrs
* clang-format
Diffstat (limited to 'src/managers/AnimationManager.cpp')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index ab81841c..a9a72941 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -79,11 +79,11 @@ void CAnimationManager::tick() { const float SPENT = av->getPercent(); // window stuff - const auto PWINDOW = (CWindow*)av->m_pWindow; - const auto PWORKSPACE = (CWorkspace*)av->m_pWorkspace; - const auto PLAYER = (SLayerSurface*)av->m_pLayer; - CMonitor* PMONITOR = nullptr; - bool animationsDisabled = animGlobalDisabled; + const auto PWINDOW = (CWindow*)av->m_pWindow; + PHLWORKSPACE PWORKSPACE = av->m_pWorkspace.lock(); + const auto PLAYER = (SLayerSurface*)av->m_pLayer; + CMonitor* PMONITOR = nullptr; + bool animationsDisabled = animGlobalDisabled; if (PWINDOW) { if (av->m_eDamagePolicy == AVARDAMAGE_ENTIRE) { @@ -111,7 +111,7 @@ void CAnimationManager::tick() { // TODO: just make this into a damn callback already vax... for (auto& w : g_pCompositor->m_vWindows) { - if (!w->m_bIsMapped || w->isHidden() || w->m_iWorkspaceID != PWORKSPACE->m_iID) + if (!w->m_bIsMapped || w->isHidden() || w->m_pWorkspace != PWORKSPACE) continue; if (w->m_bIsFloating && !w->m_bPinned) { @@ -129,7 +129,7 @@ void CAnimationManager::tick() { // damage any workspace window that is on any monitor for (auto& w : g_pCompositor->m_vWindows) { - if (!g_pCompositor->windowValidMapped(w.get()) || w->m_iWorkspaceID != PWORKSPACE->m_iID || w->m_bPinned) + if (!g_pCompositor->windowValidMapped(w.get()) || w->m_pWorkspace != PWORKSPACE || w->m_bPinned) continue; g_pHyprRenderer->damageWindow(w.get()); @@ -146,7 +146,7 @@ void CAnimationManager::tick() { animationsDisabled = animationsDisabled || PLAYER->noAnimations; } - const bool VISIBLE = PWINDOW ? g_pCompositor->isWorkspaceVisible(PWINDOW->m_iWorkspaceID) : true; + const bool VISIBLE = PWINDOW && PWINDOW->m_pWorkspace ? g_pCompositor->isWorkspaceVisible(PWINDOW->workspaceID()) : true; // beziers are with a switch unforto // TODO: maybe do something cleaner @@ -212,7 +212,7 @@ void CAnimationManager::tick() { g_pHyprRenderer->damageWindow(PWINDOW); } else if (PWORKSPACE) { for (auto& w : g_pCompositor->m_vWindows) { - if (!g_pCompositor->windowValidMapped(w.get()) || w->m_iWorkspaceID != PWORKSPACE->m_iID) + if (!g_pCompositor->windowValidMapped(w.get()) || w->m_pWorkspace != PWORKSPACE) continue; w->updateWindowDecos(); |
