diff options
| author | Richard Potter <47724110+kirpy0x@users.noreply.github.com> | 2025-10-13 06:08:40 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-13 13:08:40 +0100 |
| commit | 7fcaf332e8bacd62c04ba5805ea5d2ab91b38da4 (patch) | |
| tree | 3d6792f7d6f6fdded8b84dabfdc328d2d39eabad /src/desktop/Window.cpp | |
| parent | 6582f42db85bd6e7216d6e77c839f03933974da4 (diff) | |
layouts: apply [min|max]size window rules to dwindle & master layouts (#11898)
Uses min/max rules in the tiled layouts, akin to pseudotiling
Diffstat (limited to 'src/desktop/Window.cpp')
| -rw-r--r-- | src/desktop/Window.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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<CWindowRule>& 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<Hyprlang::INT>("misc:size_limits_tiled"); switch (r->m_ruleType) { case CWindowRule::RULE_TAG: { @@ -751,7 +752,7 @@ void CWindow::applyDynamicRule(const SP<CWindowRule>& r) { } case CWindowRule::RULE_MAXSIZE: { try { - if (!m_isFloating) + if (!m_isFloating && !sc<bool>(*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<CWindowRule>& r) { } case CWindowRule::RULE_MINSIZE: { try { - if (!m_isFloating) + if (!m_isFloating && !sc<bool>(*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<Vector2D> minSize, const std::optional<Vector2D> 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; |
