use sizehints if existent for X11 default floating

This commit is contained in:
vaxerski 2022-08-30 13:07:54 +02:00
parent 48eb2e0d6f
commit d35d949bc5

View file

@ -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);
}