From 38c1e72c9d81fcdad8f173e06102a5da18836230 Mon Sep 17 00:00:00 2001 From: ItsOhen Date: Mon, 29 Sep 2025 20:10:34 +0200 Subject: rules: fix some monitor rules (#11873) --- src/config/ConfigManager.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 206de193..1ff2d293 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -2669,16 +2669,17 @@ std::optional CConfigManager::handleWindowRule(const std::string& c bool parsingParams = false; for (const auto& varStr : VARLIST) { - std::string_view var = varStr; - auto sep = var.find(':'); - std::string_view key = (sep != std::string_view::npos) ? var.substr(0, sep) : var; + std::string_view var = varStr; + auto sep = var.find(':'); + std::string_view key = (sep != std::string_view::npos) ? var.substr(0, sep) : var; + bool isParam = (sep != std::string_view::npos && !(key.starts_with("workspace ") || (key.starts_with("monitor ")) || key.ends_with("plugin"))); if (!parsingParams) { - // Don't be alarmed, ends_with is a single memcmp, i went and checked. - if (sep == std::string_view::npos || key.ends_with("plugin") || key.ends_with("special")) { + if (!isParam) { tokens.emplace_back(var); continue; } + parsingParams = true; } @@ -2964,7 +2965,7 @@ std::optional CConfigManager::handleWorkspaceRules(const std::strin CHECK_OR_THROW(configStringToInt(rule.substr(delim + 11))) wsRule.isPersistent = *X; } else if ((delim = rule.find("defaultName:")) != std::string::npos) - wsRule.defaultName = rule.substr(delim + 12); + wsRule.defaultName = trim(rule.substr(delim + 12)); else if ((delim = rule.find(ruleOnCreatedEmpty)) != std::string::npos) { CHECK_OR_THROW(cleanCmdForWorkspace(name, rule.substr(delim + ruleOnCreatedEmptyLen))) wsRule.onCreatedEmptyRunCmd = *X; -- cgit v1.2.3