From 7fcaf332e8bacd62c04ba5805ea5d2ab91b38da4 Mon Sep 17 00:00:00 2001 From: Richard Potter <47724110+kirpy0x@users.noreply.github.com> Date: Mon, 13 Oct 2025 06:08:40 -0600 Subject: layouts: apply [min|max]size window rules to dwindle & master layouts (#11898) Uses min/max rules in the tiled layouts, akin to pseudotiling --- src/desktop/Window.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/desktop/Window.cpp') diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 49b1b698..b2b43ec1 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -634,7 +634,8 @@ bool CWindow::isHidden() { } void CWindow::applyDynamicRule(const SP& r) { - const eOverridePriority priority = r->m_execRule ? PRIORITY_SET_PROP : PRIORITY_WINDOW_RULE; + const eOverridePriority priority = r->m_execRule ? PRIORITY_SET_PROP : PRIORITY_WINDOW_RULE; + static auto PCLAMP_TILED = CConfigValue("misc:size_limits_tiled"); switch (r->m_ruleType) { case CWindowRule::RULE_TAG: { @@ -751,7 +752,7 @@ void CWindow::applyDynamicRule(const SP& r) { } case CWindowRule::RULE_MAXSIZE: { try { - if (!m_isFloating) + if (!m_isFloating && !sc(*PCLAMP_TILED)) return; const auto VEC = configStringToVector2D(r->m_rule.substr(8)); if (VEC.x < 1 || VEC.y < 1) { @@ -767,7 +768,7 @@ void CWindow::applyDynamicRule(const SP& r) { } case CWindowRule::RULE_MINSIZE: { try { - if (!m_isFloating) + if (!m_isFloating && !sc(*PCLAMP_TILED)) return; const auto VEC = configStringToVector2D(r->m_rule.substr(8)); if (VEC.x < 1 || VEC.y < 1) { @@ -1359,7 +1360,8 @@ int CWindow::surfacesCount() { void CWindow::clampWindowSize(const std::optional minSize, const std::optional maxSize) { const Vector2D REALSIZE = m_realSize->goal(); - const Vector2D NEWSIZE = REALSIZE.clamp(minSize.value_or(Vector2D{MIN_WINDOW_SIZE, MIN_WINDOW_SIZE}), maxSize.value_or(Vector2D{INFINITY, INFINITY})); + const Vector2D MAX = isFullscreen() ? Vector2D{INFINITY, INFINITY} : maxSize.value_or(Vector2D{INFINITY, INFINITY}); + const Vector2D NEWSIZE = REALSIZE.clamp(minSize.value_or(Vector2D{MIN_WINDOW_SIZE, MIN_WINDOW_SIZE}), MAX); const Vector2D DELTA = REALSIZE - NEWSIZE; *m_realPosition = m_realPosition->goal() + DELTA / 2.0; -- cgit v1.2.3