internal: Ensure unique identifiers for persistent workspaces (#11409)

This commit is contained in:
Arnaud
2025-08-13 09:45:34 +02:00
committed by GitHub
parent 2b6e2ceb2e
commit aa6a78f0a4
2 changed files with 11 additions and 1 deletions

View File

@@ -1727,6 +1727,14 @@ WORKSPACEID CCompositor::getNextAvailableNamedWorkspace() {
lowest = w->m_id;
}
// Give priority to persistent workspaces to avoid any conflicts between them.
for (auto const& rule : g_pConfigManager->getAllWorkspaceRules()) {
if (!rule.isPersistent)
continue;
if (rule.workspaceId < -1 && rule.workspaceId < lowest)
lowest = rule.workspaceId;
}
return lowest - 1;
}