config/rule: don't populate ID field for automatically id-managed workspaces

This commit is contained in:
Vaxry 2025-10-27 21:29:35 +00:00
parent 40831a90a0
commit 431325ff0c
No known key found for this signature in database
GPG key ID: 665806380871D640
6 changed files with 19 additions and 12 deletions

View file

@ -2396,12 +2396,12 @@ std::optional<std::string> CConfigManager::handleMonitor(const std::string& comm
parser.parseVRR(ARGS[argno + 1]);
argno++;
} else if (ARGS[argno] == "workspace") {
const auto& [id, name] = getWorkspaceIDNameFromString(ARGS[argno + 1]);
const auto& [id, name, isAutoID] = getWorkspaceIDNameFromString(ARGS[argno + 1]);
SWorkspaceRule wsRule;
wsRule.monitor = parser.name();
wsRule.workspaceString = ARGS[argno + 1];
wsRule.workspaceId = id;
wsRule.workspaceId = isAutoID ? WORKSPACE_INVALID : id;
wsRule.workspaceName = name;
m_workspaceRules.emplace_back(wsRule);
@ -2915,7 +2915,7 @@ std::optional<std::string> CConfigManager::handleWorkspaceRules(const std::strin
auto first_ident = trim(value.substr(0, FIRST_DELIM));
const auto& [id, name] = getWorkspaceIDNameFromString(first_ident);
const auto& [id, name, isAutoID] = getWorkspaceIDNameFromString(first_ident);
auto rules = value.substr(FIRST_DELIM + 1);
SWorkspaceRule wsRule;
@ -3015,8 +3015,8 @@ std::optional<std::string> CConfigManager::handleWorkspaceRules(const std::strin
return R;
}
wsRule.workspaceId = id;
wsRule.workspaceName = name;
wsRule.workspaceId = isAutoID ? WORKSPACE_INVALID : id;
const auto IT = std::ranges::find_if(m_workspaceRules, [&](const auto& other) { return other.workspaceString == wsRule.workspaceString; });