summaryrefslogtreecommitdiff
path: root/src/desktop/rule/windowRule/WindowRule.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-04-28 18:10:25 +0100
committerGitHub <noreply@github.com>2026-04-28 18:10:25 +0100
commit94b90a2cb0b4a0e13018cd5ebbf09394abf3b96b (patch)
tree484d32baaab1acdaab7a817c86aa89f117a21059 /src/desktop/rule/windowRule/WindowRule.hpp
parentab75bbfbecdfb4a0355106f740944c87cb9edd4c (diff)
config/lua: add ExpressionVec2, allow using a table for vec2 rules (#14197)
Diffstat (limited to 'src/desktop/rule/windowRule/WindowRule.hpp')
-rw-r--r--src/desktop/rule/windowRule/WindowRule.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/desktop/rule/windowRule/WindowRule.hpp b/src/desktop/rule/windowRule/WindowRule.hpp
index 61fc1520..3701ae35 100644
--- a/src/desktop/rule/windowRule/WindowRule.hpp
+++ b/src/desktop/rule/windowRule/WindowRule.hpp
@@ -5,6 +5,7 @@
#include "../../types/OverridableVar.hpp"
#include "WindowRuleEffectContainer.hpp"
#include "../../../config/shared/complex/ComplexDataTypes.hpp"
+#include "../../../helpers/math/Expression.hpp"
#include "../../../helpers/math/Math.hpp"
#include <expected>
@@ -30,7 +31,8 @@ namespace Desktop::Rule {
std::optional<Config::CGradientValueData> inactive;
};
- using WindowRuleEffectValue = std::variant<std::monostate, bool, int64_t, float, std::string, std::vector<std::string>, SFullscreenStateRule, SOpacityRule, SBorderColorRule>;
+ using WindowRuleEffectValue =
+ std::variant<std::monostate, bool, int64_t, float, std::string, std::vector<std::string>, SFullscreenStateRule, SOpacityRule, SBorderColorRule, Math::SExpressionVec2>;
struct SWindowRuleEffect {
using storageType = CWindowRuleEffectContainer::storageType;
@@ -50,12 +52,16 @@ namespace Desktop::Rule {
CWindowRule(const std::string& name = "");
virtual ~CWindowRule() = default;
+ using Base::addEffect;
+
CWindowRule(const CWindowRule&) = default;
CWindowRule(CWindowRule&) = default;
CWindowRule(CWindowRule&&) = default;
static std::expected<SP<CWindowRule>, std::string> buildFromExecString(std::string&&);
+ std::expected<void, std::string> addEffect(storageType e, const Math::SExpressionVec2& expr);
+
bool matches(PHLWINDOW w, bool allowEnvLookup = false);
private: