windowrules: precompute regexes for window/layer rules
This commit is contained in:
parent
8e8073c421
commit
57921d7dbd
5 changed files with 49 additions and 14 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "LayerRule.hpp"
|
||||
#include <unordered_set>
|
||||
#include <algorithm>
|
||||
#include <re2/re2.h>
|
||||
#include "../debug/Log.hpp"
|
||||
|
||||
static const auto RULES = std::unordered_set<std::string>{"noanim", "blur", "blurpopups", "dimaround"};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
//NOLINTNEXTLINE
|
||||
namespace re2 {
|
||||
class RE2;
|
||||
};
|
||||
|
||||
class CLayerRule {
|
||||
public:
|
||||
|
|
@ -21,8 +27,10 @@ class CLayerRule {
|
|||
RULE_ZUMBA,
|
||||
};
|
||||
|
||||
eRuleType ruleType = RULE_INVALID;
|
||||
eRuleType ruleType = RULE_INVALID;
|
||||
|
||||
const std::string targetNamespace;
|
||||
const std::string rule;
|
||||
const std::string targetNamespace;
|
||||
const std::string rule;
|
||||
|
||||
std::unique_ptr<re2::RE2> rTargetNamespaceRegex;
|
||||
};
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
#include "WindowRule.hpp"
|
||||
#include <unordered_set>
|
||||
#include <algorithm>
|
||||
#include <re2/re2.h>
|
||||
#include "../config/ConfigManager.hpp"
|
||||
|
||||
static const auto RULES = std::unordered_set<std::string>{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
//NOLINTNEXTLINE
|
||||
namespace re2 {
|
||||
class RE2;
|
||||
};
|
||||
|
||||
class CWindowRule {
|
||||
public:
|
||||
|
|
@ -57,4 +63,11 @@ class CWindowRule {
|
|||
std::string szFullscreenState = ""; // empty means any
|
||||
std::string szOnWorkspace = ""; // empty means any
|
||||
std::string szWorkspace = ""; // empty means any
|
||||
|
||||
// precompiled regexes
|
||||
std::unique_ptr<re2::RE2> rTitle;
|
||||
std::unique_ptr<re2::RE2> rClass;
|
||||
std::unique_ptr<re2::RE2> rInitialTitle;
|
||||
std::unique_ptr<re2::RE2> rInitialClass;
|
||||
std::unique_ptr<re2::RE2> rV1Regex;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue