mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 16:25:59 +01:00
simplify workspace sanity checks
This commit is contained in:
parent
5d095bb9e1
commit
0baef17a02
1 changed files with 9 additions and 14 deletions
|
@ -1005,28 +1005,23 @@ CWorkspace* CCompositor::getWorkspaceByID(const int& id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCompositor::sanityCheckWorkspaces() {
|
void CCompositor::sanityCheckWorkspaces() {
|
||||||
for (auto it = m_vWorkspaces.begin(); it != m_vWorkspaces.end(); ++it) {
|
auto it = m_vWorkspaces.begin();
|
||||||
|
while (it != m_vWorkspaces.end()) {
|
||||||
const auto WINDOWSONWORKSPACE = getWindowsOnWorkspace((*it)->m_iID);
|
const auto WINDOWSONWORKSPACE = getWindowsOnWorkspace((*it)->m_iID);
|
||||||
|
|
||||||
if ((WINDOWSONWORKSPACE == 0 && !isWorkspaceVisible((*it)->m_iID))) {
|
|
||||||
it = m_vWorkspaces.erase(it);
|
|
||||||
|
|
||||||
if (it == m_vWorkspaces.end())
|
|
||||||
break;
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*it)->m_bIsSpecialWorkspace && WINDOWSONWORKSPACE == 0) {
|
if ((*it)->m_bIsSpecialWorkspace && WINDOWSONWORKSPACE == 0) {
|
||||||
getMonitorFromID((*it)->m_iMonitorID)->specialWorkspaceID = 0;
|
getMonitorFromID((*it)->m_iMonitorID)->specialWorkspaceID = 0;
|
||||||
|
|
||||||
it = m_vWorkspaces.erase(it);
|
it = m_vWorkspaces.erase(it);
|
||||||
|
|
||||||
if (it == m_vWorkspaces.end())
|
|
||||||
break;
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((WINDOWSONWORKSPACE == 0 && !isWorkspaceVisible((*it)->m_iID))) {
|
||||||
|
it = m_vWorkspaces.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue