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) --- .../algorithm/floating/default/DefaultFloatingAlgorithm.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/layout/algorithm/floating/default') diff --git a/src/layout/algorithm/floating/default/DefaultFloatingAlgorithm.cpp b/src/layout/algorithm/floating/default/DefaultFloatingAlgorithm.cpp index 0d069e4f..f8f89fcb 100644 --- a/src/layout/algorithm/floating/default/DefaultFloatingAlgorithm.cpp +++ b/src/layout/algorithm/floating/default/DefaultFloatingAlgorithm.cpp @@ -50,10 +50,10 @@ void CDefaultFloatingAlgorithm::newTarget(SP target) { // set this here so that expressions can use it. This could be wrong of course. WINDOW->m_realSize->setValueAndWarp(DESIRED_GEOM ? DESIRED_GEOM->size : DEFAULT_SIZE); - if (!WINDOW->m_ruleApplicator->static_.size.empty()) { - const auto COMPUTED = WINDOW->calculateExpression(WINDOW->m_ruleApplicator->static_.size); + if (WINDOW->m_ruleApplicator->static_.size) { + const auto COMPUTED = WINDOW->calculateExpression(*WINDOW->m_ruleApplicator->static_.size); if (!COMPUTED) - Log::logger->log(Log::ERR, "failed to parse {} as an expression", WINDOW->m_ruleApplicator->static_.size); + Log::logger->log(Log::ERR, "failed to parse {} as an expression", WINDOW->m_ruleApplicator->static_.size->toString()); else { windowGeometry.w = COMPUTED->x; windowGeometry.h = COMPUTED->y; @@ -63,10 +63,10 @@ void CDefaultFloatingAlgorithm::newTarget(SP target) { } } - if (!WINDOW->m_ruleApplicator->static_.position.empty()) { - const auto COMPUTED = WINDOW->calculateExpression(WINDOW->m_ruleApplicator->static_.position); + if (WINDOW->m_ruleApplicator->static_.position) { + const auto COMPUTED = WINDOW->calculateExpression(*WINDOW->m_ruleApplicator->static_.position); if (!COMPUTED) - Log::logger->log(Log::ERR, "failed to parse {} as an expression", WINDOW->m_ruleApplicator->static_.position); + Log::logger->log(Log::ERR, "failed to parse {} as an expression", WINDOW->m_ruleApplicator->static_.position->toString()); else { windowGeometry.x = COMPUTED->x + MONITOR_POS.x; windowGeometry.y = COMPUTED->y + MONITOR_POS.y; -- cgit v1.2.3