diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-11-10 13:39:23 +0000 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-11-10 13:39:23 +0000 |
| commit | 851df11eb595c5863bb931c32cbaa446c7071813 (patch) | |
| tree | e64d48e7effeb910f66852b93fc8eb446f6f409c /src/config/ConfigManager.cpp | |
| parent | 5f2c741f49245e90b46b2912f78cd2f3ba33d36a (diff) | |
Added exec rules
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 4bb7b7d8..12a11268 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -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); +} |
