rules/windowRuleApplicator: fix min/max size effects (#12491)

fixes #12412
This commit is contained in:
Vaxry 2025-12-27 12:43:45 +01:00 committed by GitHub
parent d7f26038ee
commit 42447a50d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 171 additions and 93 deletions

View file

@ -88,6 +88,14 @@ CBox CHyprXWaylandManager::getGeometryForWindow(PHLWINDOW pWindow) {
else if (pWindow->m_xdgSurface)
box = pWindow->m_xdgSurface->m_current.geometry;
Vector2D MINSIZE = pWindow->minSize().value_or(Vector2D{MIN_WINDOW_SIZE, MIN_WINDOW_SIZE});
Vector2D MAXSIZE = pWindow->maxSize().value_or(Math::VECTOR2D_MAX);
Vector2D oldSize = box.size();
box.w = std::clamp(box.w, MINSIZE.x, MAXSIZE.x);
box.h = std::clamp(box.h, MINSIZE.y, MAXSIZE.y);
box.translate((oldSize - box.size()) / 2.F);
return box;
}