From 67c73ec10036c5ff9bda392390ecc7af48d4feee Mon Sep 17 00:00:00 2001 From: Tyler Schneider Date: Sun, 23 Apr 2023 15:28:18 -0600 Subject: [PATCH] Fixed a crash when waking up monitors in power-saving mode (#2139) --- src/managers/AnimationManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index aaf42658c..dd18e8ae0 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -82,13 +82,19 @@ void CAnimationManager::tick() { if (PWINDOW) { WLRBOXPREV = PWINDOW->getFullWindowBoundingBox(); PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); + if (!PMONITOR) + continue; animationsDisabled = animationsDisabled || PWINDOW->m_sAdditionalConfigData.forceNoAnims; } else if (PWORKSPACE) { PMONITOR = g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID); + if (!PMONITOR) + continue; WLRBOXPREV = {(int)PMONITOR->vecPosition.x, (int)PMONITOR->vecPosition.y, (int)PMONITOR->vecSize.x, (int)PMONITOR->vecSize.y}; } else if (PLAYER) { WLRBOXPREV = PLAYER->geometry; PMONITOR = g_pCompositor->getMonitorFromVector(Vector2D(PLAYER->geometry.x, PLAYER->geometry.y) + Vector2D(PLAYER->geometry.width, PLAYER->geometry.height) / 2.f); + if (!PMONITOR) + continue; animationsDisabled = animationsDisabled || PLAYER->noAnimations; }