From da4cfb9c32fecf2e5d2fa065c9e180a2bdec76a3 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 17 Oct 2022 11:18:45 +0100 Subject: [PATCH] use size hints when available in xwayland default geom --- src/managers/XWaylandManager.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index 6d8b24fe..ffddfd34 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -71,10 +71,19 @@ void CHyprXWaylandManager::activateWindow(CWindow* pWindow, bool activate) { void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox) { if (pWindow->m_bIsX11) { - pbox->x = pWindow->m_uSurface.xwayland->x; - pbox->y = pWindow->m_uSurface.xwayland->y; - pbox->width = pWindow->m_uSurface.xwayland->width; - pbox->height = pWindow->m_uSurface.xwayland->height; + const auto SIZEHINTS = pWindow->m_uSurface.xwayland->size_hints; + + if (SIZEHINTS) { + pbox->x = SIZEHINTS->x; + pbox->y = SIZEHINTS->y; + pbox->width = SIZEHINTS->width; + pbox->height = SIZEHINTS->height; + } else { + pbox->x = pWindow->m_uSurface.xwayland->x; + pbox->y = pWindow->m_uSurface.xwayland->y; + pbox->width = pWindow->m_uSurface.xwayland->width; + pbox->height = pWindow->m_uSurface.xwayland->height; + } } else { wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, pbox); }