Added exec rules

This commit is contained in:
vaxerski
2022-11-10 13:39:23 +00:00
parent 5f2c741f49
commit 851df11eb5
3 changed files with 57 additions and 3 deletions

View File

@@ -1490,6 +1490,19 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow) {
returns.push_back(rule);
}
const auto PID = pWindow->getPID();
bool anyExecFound = false;
for (auto& er : execRequestedRules) {
if (er.iPid == PID) {
returns.push_back({er.szRule, "execRule"});
anyExecFound = true;
}
}
if (anyExecFound) // remove exec rules to unclog searches in the future, why have the garbage here.
execRequestedRules.erase(std::remove_if(execRequestedRules.begin(), execRequestedRules.end(), [&](const SExecRequestedRule& other) { return other.iPid == PID; }));
return returns;
}
@@ -1646,3 +1659,7 @@ CMonitor* CConfigManager::getBoundMonitorForWS(std::string wsname) {
return nullptr;
}
void CConfigManager::addExecRule(SExecRequestedRule rule) {
execRequestedRules.push_back(rule);
}