From 94b90a2cb0b4a0e13018cd5ebbf09394abf3b96b Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Tue, 28 Apr 2026 18:10:25 +0100 Subject: config/lua: add ExpressionVec2, allow using a table for vec2 rules (#14197) --- src/desktop/rule/windowRule/WindowRule.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/desktop/rule/windowRule/WindowRule.hpp') 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 @@ -30,7 +31,8 @@ namespace Desktop::Rule { std::optional inactive; }; - using WindowRuleEffectValue = std::variant, SFullscreenStateRule, SOpacityRule, SBorderColorRule>; + using WindowRuleEffectValue = + std::variant, 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, std::string> buildFromExecString(std::string&&); + std::expected addEffect(storageType e, const Math::SExpressionVec2& expr); + bool matches(PHLWINDOW w, bool allowEnvLookup = false); private: -- cgit v1.2.3