diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-02-03 19:53:14 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-02-03 19:53:14 +0000 |
| commit | 70cfc7cc9c4ecadbb9dd9a75f096fc70177a8ca5 (patch) | |
| tree | 912da01f1346809efcf293ef9df94c30b354e12b /src/helpers/Monitor.cpp | |
| parent | 1da0b2c02e99d3bd35f4d1a6f9a55dc403715913 (diff) | |
cmonitor: guard old workspace
Diffstat (limited to 'src/helpers/Monitor.cpp')
| -rw-r--r-- | src/helpers/Monitor.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 3ea6d49b..e4843211 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -1019,15 +1019,17 @@ void CMonitor::changeWorkspace(const PHLWORKSPACE& pWorkspace, bool internal, bo if (pWorkspace == activeWorkspace) return; - const auto POLDWORKSPACE = activeWorkspace; - POLDWORKSPACE->m_bVisible = false; - pWorkspace->m_bVisible = true; + const auto POLDWORKSPACE = activeWorkspace; + if (POLDWORKSPACE) + POLDWORKSPACE->m_bVisible = false; + pWorkspace->m_bVisible = true; activeWorkspace = pWorkspace; if (!internal) { - const auto ANIMTOLEFT = pWorkspace->m_iID > POLDWORKSPACE->m_iID; - POLDWORKSPACE->startAnim(false, ANIMTOLEFT); + const auto ANIMTOLEFT = POLDWORKSPACE && pWorkspace->m_iID > POLDWORKSPACE->m_iID; + if (POLDWORKSPACE) + POLDWORKSPACE->startAnim(false, ANIMTOLEFT); pWorkspace->startAnim(true, ANIMTOLEFT); // move pinned windows |
