mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 03:05:59 +01:00
xwayland: fixup WM_SIZE_HINTS handling according to ICCCM
This commit is contained in:
parent
f7fb7e7e49
commit
7f624d2236
1 changed files with 14 additions and 6 deletions
|
@ -76,13 +76,21 @@ void CHyprXWaylandManager::getGeometryForWindow(PHLWINDOW pWindow, CBox* pbox) {
|
||||||
const auto SIZEHINTS = pWindow->m_pXWaylandSurface->sizeHints.get();
|
const auto SIZEHINTS = pWindow->m_pXWaylandSurface->sizeHints.get();
|
||||||
|
|
||||||
if (SIZEHINTS && pWindow->m_iX11Type != 2) {
|
if (SIZEHINTS && pWindow->m_iX11Type != 2) {
|
||||||
pbox->x = SIZEHINTS->x;
|
// WM_SIZE_HINTS' x,y,w,h is deprecated it seems.
|
||||||
pbox->y = SIZEHINTS->y;
|
// Source: https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#wm_normal_hints_property
|
||||||
pbox->width = SIZEHINTS->width;
|
pbox->x = pWindow->m_pXWaylandSurface->geometry.x;
|
||||||
pbox->height = SIZEHINTS->height;
|
pbox->y = pWindow->m_pXWaylandSurface->geometry.y;
|
||||||
|
|
||||||
|
if ((SIZEHINTS->flags & 0x2 /* ICCCM USSize */) || (SIZEHINTS->flags & 0x8 /* ICCCM PSize */)) {
|
||||||
|
pbox->w = SIZEHINTS->base_width;
|
||||||
|
pbox->h = SIZEHINTS->base_height;
|
||||||
} else {
|
} else {
|
||||||
*pbox = pWindow->m_pXWaylandSurface->geometry;
|
pbox->w = pWindow->m_pXWaylandSurface->geometry.w;
|
||||||
|
pbox->h = pWindow->m_pXWaylandSurface->geometry.h;
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
*pbox = pWindow->m_pXWaylandSurface->geometry;
|
||||||
|
|
||||||
} else if (pWindow->m_pXDGSurface)
|
} else if (pWindow->m_pXDGSurface)
|
||||||
*pbox = pWindow->m_pXDGSurface->current.geometry;
|
*pbox = pWindow->m_pXDGSurface->current.geometry;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue