diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-12-16 19:05:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-16 19:05:24 +0100 |
| commit | dab50b3ef3a1bad7f68320538223b6b41d1c6012 (patch) | |
| tree | 3b911a592b2bece2017bdfdcc7557cbc6a3d22b0 /src/desktop/WindowRule.hpp | |
| parent | eaac5c7cbdd40a2211c75a770df56bd2153b77cb (diff) | |
core: Optimize window/layer rule application and scanning (#8735)
Optimizes window and layer rule parsing and later usage.
Diffstat (limited to 'src/desktop/WindowRule.hpp')
| -rw-r--r-- | src/desktop/WindowRule.hpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/desktop/WindowRule.hpp b/src/desktop/WindowRule.hpp new file mode 100644 index 00000000..d1034cf6 --- /dev/null +++ b/src/desktop/WindowRule.hpp @@ -0,0 +1,65 @@ +#pragma once + +#include <string> +#include <cstdint> + +class CWindowRule { + public: + CWindowRule(const std::string& rule, const std::string& value, bool isV2 = false, bool isExecRule = false); + + enum eRuleType : uint8_t { + RULE_INVALID = 0, + RULE_FLOAT, + RULE_FULLSCREEN, + RULE_MAXIMIZE, + RULE_NOINITIALFOCUS, + RULE_PIN, + RULE_STAYFOCUSED, + RULE_TILE, + RULE_RENDERUNFOCUSED, + RULE_ANIMATION, + RULE_BORDERCOLOR, + RULE_BORDERSIZE, + RULE_CENTER, + RULE_FULLSCREENSTATE, + RULE_GROUP, + RULE_IDLEINHIBIT, + RULE_MAXSIZE, + RULE_MINSIZE, + RULE_MONITOR, + RULE_MOVE, + RULE_OPACITY, + RULE_PLUGIN, + RULE_PSEUDO, + RULE_ROUNDING, + RULE_SCROLLMOUSE, + RULE_SCROLLTOUCHPAD, + RULE_SIZE, + RULE_SUPPRESSEVENT, + RULE_TAG, + RULE_WORKSPACE, + RULE_XRAY, + RULE_PROP, + }; + + eRuleType ruleType = RULE_INVALID; + + const std::string szValue; + const std::string szRule; + const bool v2 = false; + const bool execRule = false; + + std::string szTitle; + std::string szClass; + std::string szInitialTitle; + std::string szInitialClass; + std::string szTag; + int bX11 = -1; // -1 means "ANY" + int bFloating = -1; + int bFullscreen = -1; + int bPinned = -1; + int bFocus = -1; + std::string szFullscreenState = ""; // empty means any + std::string szOnWorkspace = ""; // empty means any + std::string szWorkspace = ""; // empty means any +};
\ No newline at end of file |
