summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-30 16:11:26 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-30 16:11:26 +0200
commit990d3f232b90cb876715c2712cc997f280cdc7be (patch)
treefc7be713435041ab903e0c4c5970bf85b664b705 /src
parent97b515edb7529b9567bef2a1d7bd31f4ae9222ea (diff)
fix another crash
Diffstat (limited to 'src')
-rw-r--r--src/Compositor.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 20a4add4..c3758513 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -680,22 +680,24 @@ CWorkspace* CCompositor::getWorkspaceByID(const int& id) {
void CCompositor::sanityCheckWorkspaces() {
for (auto it = m_vWorkspaces.begin(); it != m_vWorkspaces.end(); ++it) {
- if (!it->get())
- return; // why does this occur when switching from an empty workspace to an open one?
+ const auto WINDOWSONWORKSPACE = getWindowsOnWorkspace((*it)->m_iID);
- if ((getWindowsOnWorkspace((*it)->m_iID) == 0 && !isWorkspaceVisible((*it)->m_iID))) {
+ if ((WINDOWSONWORKSPACE == 0 && !isWorkspaceVisible((*it)->m_iID))) {
it = m_vWorkspaces.erase(it);
- }
- if (it == m_vWorkspaces.end())
- continue;
+ if (it == m_vWorkspaces.end())
+ break;
+ }
- if ((*it)->m_iID == SPECIAL_WORKSPACE_ID && getWindowsOnWorkspace((*it)->m_iID) == 0) {
+ if ((*it)->m_iID == SPECIAL_WORKSPACE_ID && WINDOWSONWORKSPACE == 0) {
for (auto& m : m_vMonitors) {
m->specialWorkspaceOpen = false;
}
it = m_vWorkspaces.erase(it);
+
+ if (it == m_vWorkspaces.end())
+ break;
}
}
}