From 386708563c3d9d85ffd60b4eeb6c767d29f948db Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 19 Oct 2023 16:04:48 +0100 Subject: [PATCH] workspacerules: search for special properly fixes #3537 --- src/config/ConfigManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 2c3f6474..f0961aa0 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1850,7 +1850,10 @@ SMonitorRule CConfigManager::getMonitorRuleFor(const std::string& name, const st SWorkspaceRule CConfigManager::getWorkspaceRuleFor(CWorkspace* pWorkspace) { const auto WORKSPACEIDSTR = std::to_string(pWorkspace->m_iID); const auto IT = std::find_if(m_dWorkspaceRules.begin(), m_dWorkspaceRules.end(), [&](const auto& other) { - return other.workspaceName == pWorkspace->m_szName || (pWorkspace->m_iID > 0 && WORKSPACEIDSTR == other.workspaceName); + return other.workspaceName == pWorkspace->m_szName /* name matches */ + || (pWorkspace->m_bIsSpecialWorkspace && other.workspaceName.starts_with("special:") && + other.workspaceName.substr(8) == pWorkspace->m_szName) /* special and special:name */ + || (pWorkspace->m_iID > 0 && WORKSPACEIDSTR == other.workspaceName); /* id matches and workspace is numerical */ }); if (IT == m_dWorkspaceRules.end()) return SWorkspaceRule{};