mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 04:49:48 +01:00
fix another crash
This commit is contained in:
parent
97b515edb7
commit
990d3f232b
1 changed files with 9 additions and 7 deletions
|
@ -680,22 +680,24 @@ CWorkspace* CCompositor::getWorkspaceByID(const int& id) {
|
||||||
|
|
||||||
void CCompositor::sanityCheckWorkspaces() {
|
void CCompositor::sanityCheckWorkspaces() {
|
||||||
for (auto it = m_vWorkspaces.begin(); it != m_vWorkspaces.end(); ++it) {
|
for (auto it = m_vWorkspaces.begin(); it != m_vWorkspaces.end(); ++it) {
|
||||||
if (!it->get())
|
const auto WINDOWSONWORKSPACE = getWindowsOnWorkspace((*it)->m_iID);
|
||||||
return; // why does this occur when switching from an empty workspace to an open one?
|
|
||||||
|
|
||||||
if ((getWindowsOnWorkspace((*it)->m_iID) == 0 && !isWorkspaceVisible((*it)->m_iID))) {
|
if ((WINDOWSONWORKSPACE == 0 && !isWorkspaceVisible((*it)->m_iID))) {
|
||||||
it = m_vWorkspaces.erase(it);
|
it = m_vWorkspaces.erase(it);
|
||||||
|
|
||||||
|
if (it == m_vWorkspaces.end())
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it == m_vWorkspaces.end())
|
if ((*it)->m_iID == SPECIAL_WORKSPACE_ID && WINDOWSONWORKSPACE == 0) {
|
||||||
continue;
|
|
||||||
|
|
||||||
if ((*it)->m_iID == SPECIAL_WORKSPACE_ID && getWindowsOnWorkspace((*it)->m_iID) == 0) {
|
|
||||||
for (auto& m : m_vMonitors) {
|
for (auto& m : m_vMonitors) {
|
||||||
m->specialWorkspaceOpen = false;
|
m->specialWorkspaceOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
it = m_vWorkspaces.erase(it);
|
it = m_vWorkspaces.erase(it);
|
||||||
|
|
||||||
|
if (it == m_vWorkspaces.end())
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue