diff options
author | vaxerski <[email protected]> | 2022-08-30 13:07:54 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-08-30 13:07:54 +0200 |
commit | d35d949bc53c32c0343ba6ac02c8f31ff0654ed2 (patch) | |
tree | 0ba8e2801941d802900892a37519cab67c08e0fa | |
parent | 48eb2e0d6fd756ec181b722c526f13453fa9c123 (diff) | |
download | Hyprland-d35d949bc53c32c0343ba6ac02c8f31ff0654ed2.tar.gz Hyprland-d35d949bc53c32c0343ba6ac02c8f31ff0654ed2.zip |
use sizehints if existent for X11 default floating
-rw-r--r-- | src/managers/XWaylandManager.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index 14642878..27e8f8ee 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -63,10 +63,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 && SIZEHINTS->width > 5 && SIZEHINTS->height > 5) { + 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); } |