use size hints when available in xwayland default geom

This commit is contained in:
vaxerski 2022-10-17 11:18:45 +01:00
parent 58375bc87a
commit da4cfb9c32

View file

@ -71,10 +71,19 @@ void CHyprXWaylandManager::activateWindow(CWindow* pWindow, bool activate) {
void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox) { void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox) {
if (pWindow->m_bIsX11) { if (pWindow->m_bIsX11) {
pbox->x = pWindow->m_uSurface.xwayland->x; const auto SIZEHINTS = pWindow->m_uSurface.xwayland->size_hints;
pbox->y = pWindow->m_uSurface.xwayland->y;
pbox->width = pWindow->m_uSurface.xwayland->width; if (SIZEHINTS) {
pbox->height = pWindow->m_uSurface.xwayland->height; 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 { } else {
wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, pbox); wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, pbox);
} }