From 4fd683cc84d670d97f6f7020001410f2fb3daa6c Mon Sep 17 00:00:00 2001 From: save196 Date: Tue, 15 Sep 2026 18:11:48 +0000 Subject: [PATCH] fix X11 clients shifting by the border width on map c->geom includes the border, but client_get_geometry() returns the content position. Subtract the border, clamped to the layout edges. --- dwl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dwl.c b/dwl.c index e07a269..26fb3a0 100644 --- a/dwl.c +++ b/dwl.c @@ -1919,6 +1919,11 @@ mapnotify(struct wl_listener *listener, void *data) WLR_EDGE_RIGHT); c->geom.width += 2 * c->bw; c->geom.height += 2 * c->bw; + if (client_is_x11(c)) { + int x = c->geom.x - (int)c->bw, y = c->geom.y - (int)c->bw; + c->geom.x = c->geom.x < sgeom.x ? x : MAX(x, sgeom.x); + c->geom.y = c->geom.y < sgeom.y ? y : MAX(y, sgeom.y); + } /* Insert this client into client lists. */ wl_list_insert(&clients, &c->link);