mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-11 02:01:53 -07:00
xwayland: respect window size set by configure requests (#9190)
This commit is contained in:
@@ -82,29 +82,9 @@ CBox CHyprXWaylandManager::getGeometryForWindow(PHLWINDOW pWindow) {
|
|||||||
|
|
||||||
CBox box;
|
CBox box;
|
||||||
|
|
||||||
if (pWindow->m_bIsX11) {
|
if (pWindow->m_bIsX11)
|
||||||
const auto SIZEHINTS = pWindow->m_pXWaylandSurface->sizeHints.get();
|
|
||||||
|
|
||||||
if (SIZEHINTS && !pWindow->isX11OverrideRedirect()) {
|
|
||||||
// WM_SIZE_HINTS' x,y,w,h is deprecated it seems.
|
|
||||||
// Source: https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#wm_normal_hints_property
|
|
||||||
box.x = pWindow->m_pXWaylandSurface->geometry.x;
|
|
||||||
box.y = pWindow->m_pXWaylandSurface->geometry.y;
|
|
||||||
|
|
||||||
constexpr int ICCCM_USSize = 0x2;
|
|
||||||
constexpr int ICCCM_PSize = 0x8;
|
|
||||||
|
|
||||||
if ((SIZEHINTS->flags & ICCCM_USSize) || (SIZEHINTS->flags & ICCCM_PSize)) {
|
|
||||||
box.w = SIZEHINTS->base_width;
|
|
||||||
box.h = SIZEHINTS->base_height;
|
|
||||||
} else {
|
|
||||||
box.w = pWindow->m_pXWaylandSurface->geometry.w;
|
|
||||||
box.h = pWindow->m_pXWaylandSurface->geometry.h;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
box = pWindow->m_pXWaylandSurface->geometry;
|
box = pWindow->m_pXWaylandSurface->geometry;
|
||||||
|
else if (pWindow->m_pXDGSurface)
|
||||||
} else if (pWindow->m_pXDGSurface)
|
|
||||||
box = pWindow->m_pXDGSurface->current.geometry;
|
box = pWindow->m_pXDGSurface->current.geometry;
|
||||||
|
|
||||||
return box;
|
return box;
|
||||||
|
@@ -102,8 +102,8 @@ void CXWM::handleMapRequest(xcb_map_request_event_t* e) {
|
|||||||
const bool HAS_HINTS = XSURF->sizeHints && Vector2D{XSURF->sizeHints->base_width, XSURF->sizeHints->base_height} > Vector2D{5, 5};
|
const bool HAS_HINTS = XSURF->sizeHints && Vector2D{XSURF->sizeHints->base_width, XSURF->sizeHints->base_height} > Vector2D{5, 5};
|
||||||
const auto DESIREDSIZE = HAS_HINTS ? Vector2D{XSURF->sizeHints->base_width, XSURF->sizeHints->base_height} : Vector2D{800, 800};
|
const auto DESIREDSIZE = HAS_HINTS ? Vector2D{XSURF->sizeHints->base_width, XSURF->sizeHints->base_height} : Vector2D{800, 800};
|
||||||
|
|
||||||
// if it's too small, or its base size is set, configure it.
|
// if it's too small, configure it.
|
||||||
if ((SMALL || HAS_HINTS) && !XSURF->overrideRedirect) // default to 800 x 800
|
if (SMALL && !XSURF->overrideRedirect) // default to 800 x 800
|
||||||
XSURF->configure({XSURF->geometry.pos(), DESIREDSIZE});
|
XSURF->configure({XSURF->geometry.pos(), DESIREDSIZE});
|
||||||
|
|
||||||
Debug::log(LOG, "[xwm] Mapping window {} in X (geometry {}x{} at {}x{}))", e->window, XSURF->geometry.width, XSURF->geometry.height, XSURF->geometry.x, XSURF->geometry.y);
|
Debug::log(LOG, "[xwm] Mapping window {} in X (geometry {}x{} at {}x{}))", e->window, XSURF->geometry.width, XSURF->geometry.height, XSURF->geometry.x, XSURF->geometry.y);
|
||||||
|
Reference in New Issue
Block a user