diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-03-01 15:56:44 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-03-01 15:56:44 +0000 |
| commit | 11943f761e8f2d5dc98fb3b6582530aea57e5902 (patch) | |
| tree | 0bcee2e57ab7abd8c87a0def71439db3e8d0e837 /src/helpers/Monitor.cpp | |
| parent | f148b96beae2f6e1a0bf94292ab6b6f595228140 (diff) | |
monitor: avoid crash on expired special workspace monitor owner
fixes #9477
Diffstat (limited to 'src/helpers/Monitor.cpp')
| -rw-r--r-- | src/helpers/Monitor.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 24db3ea4..c015b47b 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -1124,12 +1124,12 @@ void CMonitor::setSpecialWorkspace(const PHLWORKSPACE& pWorkspace) { bool animate = true; //close if open elsewhere const auto PMONITORWORKSPACEOWNER = pWorkspace->m_pMonitor.lock(); - if (PMONITORWORKSPACEOWNER->activeSpecialWorkspace == pWorkspace) { - PMONITORWORKSPACEOWNER->activeSpecialWorkspace.reset(); - g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITORWORKSPACEOWNER->ID); - g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", "," + PMONITORWORKSPACEOWNER->szName}); + if (const auto PMWSOWNER = pWorkspace->m_pMonitor.lock(); PMWSOWNER && PMWSOWNER->activeSpecialWorkspace == pWorkspace) { + PMWSOWNER->activeSpecialWorkspace.reset(); + g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMWSOWNER->ID); + g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", "," + PMWSOWNER->szName}); - const auto PACTIVEWORKSPACE = PMONITORWORKSPACEOWNER->activeWorkspace; + const auto PACTIVEWORKSPACE = PMWSOWNER->activeWorkspace; g_pCompositor->updateFullscreenFadeOnWorkspace(PACTIVEWORKSPACE); animate = false; |
