diff --git a/src/dwm.c b/src/dwm.c index 6d82cba..9f19db8 100644 --- a/src/dwm.c +++ b/src/dwm.c @@ -1132,6 +1132,10 @@ manage(Window w, XWindowAttributes *wa) c->bw = borderpx; wc.border_width = c->bw; + + if(c->x == selmon->wx) c->x += (c->mon->ww - WIDTH(c)) / 2 - c->bw; + if(c->y == selmon->wy) c->y += (c->mon->wh - HEIGHT(c)) / 2 - c->bw; + XConfigureWindow(dpy, w, CWBorderWidth, &wc); XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); configure(c); /* propagates border_width, if size doesn't change */