xwayland: validate size hints before floating (#13361)

This commit is contained in:
Skidam 2026-02-26 17:42:49 +01:00 committed by GitHub
parent c71fbd854d
commit cc14dd1baf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -129,7 +129,8 @@ bool CHyprXWaylandManager::shouldBeFloated(PHLWINDOW pWindow, bool pending) {
const auto SIZEHINTS = pWindow->m_xwaylandSurface->m_sizeHints.get();
if (pWindow->m_xwaylandSurface->m_transient || pWindow->m_xwaylandSurface->m_parent ||
(SIZEHINTS && (SIZEHINTS->min_width == SIZEHINTS->max_width) && (SIZEHINTS->min_height == SIZEHINTS->max_height)))
(SIZEHINTS && SIZEHINTS->min_width > 0 && SIZEHINTS->min_height > 0 && SIZEHINTS->max_width > 0 && SIZEHINTS->max_height > 0 &&
(SIZEHINTS->min_width == SIZEHINTS->max_width) && (SIZEHINTS->min_height == SIZEHINTS->max_height)))
return true;
} else {
if (!pWindow->m_xdgSurface || !pWindow->m_xdgSurface->m_toplevel)