-- lincoln auster they/them
--- dwm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dwm.c b/dwm.c index 5e4d494..77dea02 100644 --- a/dwm.c +++ b/dwm.c _AT_@ -286,7 +286,7 @@ applyrules(Client *c) XClassHint ch = { NULL, NULL }; /* rule matching */ - c->isfloating = 0; + c->isfloating = 1; c->tags = 0; XGetClassHint(dpy, c->win, &ch); class = ch.res_class ? ch.res_class : broken; _AT_@ -1040,11 +1040,13 @@ manage(Window w, XWindowAttributes *wa) applyrules(c); } - if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw) - c->x = c->mon->mx + c->mon->mw - WIDTH(c); - if (c->y + HEIGHT(c) > c->mon->my + c->mon->mh) - c->y = c->mon->my + c->mon->mh - HEIGHT(c); + /* center the window */ + c->x = c->mon->mx + c->mon->mw / 2 - c->w / 2; + c->y = c->mon->my + c->mon->mh / 2 - c->h / 2; + c->x = MAX(c->x, c->mon->mx); + c->y = MAX(c->y, c->mon->my); + /* only fix client y-offset, if the client center might cover the bar */ c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx) && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my); -- 2.31.1Received on Tue Nov 30 2021 - 15:46:01 CET
This archive was generated by hypermail 2.3.0 : Tue Nov 30 2021 - 19:48:08 CET