X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=dwm.c;h=77a91acc51bb2d4b0a39008ac9c9ff0e13399f6f;hb=2bb51b3246d6732dc0ac568451ca875b7227b588;hp=489ba80a9f82074399060c2df262bf8a608342da;hpb=be39dddcc5bad25e0e1430228e196c3837f1c3e7;p=dwm.git diff --git a/dwm.c b/dwm.c index 489ba80..77a91ac 100644 --- a/dwm.c +++ b/dwm.c @@ -128,7 +128,7 @@ typedef struct { } Rule; /* function declarations */ -static void adjustborder(Client *c, Bool issingle); +static void adjustborder(Client *c, unsigned int bw); static void applyrules(Client *c); static void arrange(void); static void attach(Client *c); @@ -246,12 +246,11 @@ struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1 /* function implementations */ void -adjustborder(Client *c, Bool issingle) { +adjustborder(Client *c, unsigned int bw) { XWindowChanges wc; - wc.border_width = issingle ? 0 : borderpx; - if(c->bw != wc.border_width) { - c->bw = wc.border_width; + if(c->bw != bw) { + c->bw = wc.border_width = bw; XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); } } @@ -270,7 +269,7 @@ applyrules(Client *c) { && (!r->class || (ch.res_class && strstr(ch.res_class, r->class))) && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) { c->isfloating = r->isfloating; - c->tags |= r->tags & TAGMASK; + c->tags |= r->tags & TAGMASK ? r->tags & TAGMASK : tagset[seltags]; } } if(ch.res_class) @@ -941,7 +940,7 @@ monocle(void) { for(n = 0, c = nexttiled(clients); c && n < 2; c = nexttiled(c->next), n++); for(c = nexttiled(clients); c; c = nexttiled(c->next)) { - adjustborder(c, n == 1); + adjustborder(c, n == 1 ? 0 : borderpx); resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, resizehints); } } @@ -1346,7 +1345,7 @@ showhide(Client *c) { if(!c) return; if(ISVISIBLE(c)) { /* show clients top down */ - adjustborder(c, False); + adjustborder(c, borderpx); XMoveWindow(dpy, c->win, c->x, c->y); if(!lt[sellt]->arrange || c->isfloating) resize(c, c->x, c->y, c->w, c->h, True); @@ -1410,7 +1409,7 @@ tile(void) { /* master */ c = nexttiled(clients); mw = mfact * ww; - adjustborder(c, n == 1); + adjustborder(c, n == 1 ? 0 : borderpx); resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints); if(--n == 0) @@ -1425,7 +1424,7 @@ tile(void) { h = wh; for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { - adjustborder(c, False); + adjustborder(c, borderpx); resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) ? wy + wh - y - 2 * c->bw : h - 2 * c->bw), resizehints); if(h != wh)