diff options
Diffstat (limited to 'src/config/shared/workspace/WorkspaceRuleManager.cpp')
| -rw-r--r-- | src/config/shared/workspace/WorkspaceRuleManager.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/config/shared/workspace/WorkspaceRuleManager.cpp b/src/config/shared/workspace/WorkspaceRuleManager.cpp index ca45873a..4c2c2b90 100644 --- a/src/config/shared/workspace/WorkspaceRuleManager.cpp +++ b/src/config/shared/workspace/WorkspaceRuleManager.cpp @@ -22,7 +22,7 @@ void CWorkspaceRuleManager::add(CWorkspaceRule&& x) { } void CWorkspaceRuleManager::replaceOrAdd(CWorkspaceRule&& x) { - auto it = std::ranges::find_if(m_rules, [&x](const auto& r) { return r.m_workspaceString == x.m_workspaceString; }); + auto it = std::ranges::find_if(m_rules, [&x](const auto& r) { return r.m_enabled && r.m_workspaceString == x.m_workspaceString; }); if (it == m_rules.end()) m_rules.emplace_back(std::move(x)); else @@ -34,6 +34,9 @@ std::optional<CWorkspaceRule> CWorkspaceRuleManager::getWorkspaceRuleFor(PHLWORK CWorkspaceRule mergedRule; for (auto const& rule : m_rules) { + if (!rule.m_enabled) + continue; + if (!workspace->matchesStaticSelector(rule.m_workspaceString)) continue; @@ -49,6 +52,9 @@ std::optional<CWorkspaceRule> CWorkspaceRuleManager::getWorkspaceRuleFor(PHLWORK std::string CWorkspaceRuleManager::getDefaultWorkspaceFor(const std::string& name) { for (auto other = m_rules.begin(); other != m_rules.end(); ++other) { + if (!other->m_enabled) + continue; + if (other->m_isDefault) { if (other->m_monitor == name) return other->m_workspaceString; @@ -72,6 +78,8 @@ PHLMONITOR CWorkspaceRuleManager::getBoundMonitorForWS(const std::string& wsname std::string CWorkspaceRuleManager::getBoundMonitorStringForWS(const std::string& wsname) { for (auto const& wr : m_rules) { + if (!wr.m_enabled) + continue; const auto WSNAME = wr.m_workspaceName.starts_with("name:") ? wr.m_workspaceName.substr(5) : wr.m_workspaceName; if (WSNAME == wsname) return wr.m_monitor; |
