diff options
| author | Anselm R Garbe <garbeam@gmail.com> | 2009-02-21 19:12:46 +0000 |
|---|---|---|
| committer | Anselm R Garbe <garbeam@gmail.com> | 2009-02-21 19:12:46 +0000 |
| commit | 1e350be22906033b950c989aedec9e2e68c3487d (patch) | |
| tree | 3c713fd563107fc7c36ea8973e5d35dcd2dd0100 | |
| parent | applied nsz' remark (diff) | |
| download | dwm-1e350be22906033b950c989aedec9e2e68c3487d.tar.gz dwm-1e350be22906033b950c989aedec9e2e68c3487d.zip | |
applied Gottox' adjustborder removal patch (thanks!)
Diffstat (limited to '')
| -rw-r--r-- | config.mk | 2 | ||||
| -rw-r--r-- | dwm.c | 20 |
2 files changed, 2 insertions, 20 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | # dwm version | 1 | # dwm version |
| 2 | VERSION = 5.4.1 | 2 | VERSION = 5.5 |
| 3 | 3 | ||
| 4 | # Customize below to fit your system | 4 | # Customize below to fit your system |
| 5 | 5 | ||
| @@ -128,7 +128,6 @@ typedef struct { | |||
| 128 | } Rule; | 128 | } Rule; |
| 129 | 129 | ||
| 130 | /* function declarations */ | 130 | /* function declarations */ |
| 131 | static void adjustborder(Client *c, unsigned int bw); | ||
| 132 | static void applyrules(Client *c); | 131 | static void applyrules(Client *c); |
| 133 | static void arrange(void); | 132 | static void arrange(void); |
| 134 | static void attach(Client *c); | 133 | static void attach(Client *c); |
| @@ -246,16 +245,6 @@ struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1 | |||
| 246 | 245 | ||
| 247 | /* function implementations */ | 246 | /* function implementations */ |
| 248 | void | 247 | void |
| 249 | adjustborder(Client *c, unsigned int bw) { | ||
| 250 | XWindowChanges wc; | ||
| 251 | |||
| 252 | if(c->bw != bw) { | ||
| 253 | c->bw = wc.border_width = bw; | ||
| 254 | XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); | ||
| 255 | } | ||
| 256 | } | ||
| 257 | |||
| 258 | void | ||
| 259 | applyrules(Client *c) { | 248 | applyrules(Client *c) { |
| 260 | unsigned int i; | 249 | unsigned int i; |
| 261 | Rule *r; | 250 | Rule *r; |
| @@ -939,12 +928,9 @@ maprequest(XEvent *e) { | |||
| 939 | 928 | ||
| 940 | void | 929 | void |
| 941 | monocle(void) { | 930 | monocle(void) { |
| 942 | unsigned int n; | ||
| 943 | Client *c; | 931 | Client *c; |
| 944 | 932 | ||
| 945 | for(n = 0, c = nexttiled(clients); c && n < 2; c = nexttiled(c->next), n++); | ||
| 946 | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { | 933 | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { |
| 947 | adjustborder(c, n == 1 ? 0 : borderpx); | ||
| 948 | resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, resizehints); | 934 | resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, resizehints); |
| 949 | } | 935 | } |
| 950 | } | 936 | } |
| @@ -1349,8 +1335,6 @@ showhide(Client *c, unsigned int ntiled) { | |||
| 1349 | if(!c) | 1335 | if(!c) |
| 1350 | return; | 1336 | return; |
| 1351 | if(ISVISIBLE(c)) { /* show clients top down */ | 1337 | if(ISVISIBLE(c)) { /* show clients top down */ |
| 1352 | if(c->isfloating || ntiled > 1) /* avoid unnecessary border reverts */ | ||
| 1353 | adjustborder(c, borderpx); | ||
| 1354 | XMoveWindow(dpy, c->win, c->x, c->y); | 1338 | XMoveWindow(dpy, c->win, c->x, c->y); |
| 1355 | if(!lt[sellt]->arrange || c->isfloating) | 1339 | if(!lt[sellt]->arrange || c->isfloating) |
| 1356 | resize(c, c->x, c->y, c->w, c->h, True); | 1340 | resize(c, c->x, c->y, c->w, c->h, True); |
| @@ -1414,7 +1398,6 @@ tile(void) { | |||
| 1414 | /* master */ | 1398 | /* master */ |
| 1415 | c = nexttiled(clients); | 1399 | c = nexttiled(clients); |
| 1416 | mw = mfact * ww; | 1400 | mw = mfact * ww; |
| 1417 | adjustborder(c, n == 1 ? 0 : borderpx); | ||
| 1418 | resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints); | 1401 | resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints); |
| 1419 | 1402 | ||
| 1420 | if(--n == 0) | 1403 | if(--n == 0) |
| @@ -1429,7 +1412,6 @@ tile(void) { | |||
| 1429 | h = wh; | 1412 | h = wh; |
| 1430 | 1413 | ||
| 1431 | for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { | 1414 | for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { |
| 1432 | adjustborder(c, borderpx); | ||
| 1433 | resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) | 1415 | resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) |
| 1434 | ? wy + wh - y - 2 * c->bw : h - 2 * c->bw), resizehints); | 1416 | ? wy + wh - y - 2 * c->bw : h - 2 * c->bw), resizehints); |
| 1435 | if(h != wh) | 1417 | if(h != wh) |
| @@ -1713,7 +1695,7 @@ main(int argc, char *argv[]) { | |||
| 1713 | die("usage: dwm [-v]\n"); | 1695 | die("usage: dwm [-v]\n"); |
| 1714 | 1696 | ||
| 1715 | if(!setlocale(LC_CTYPE, "") || !XSupportsLocale()) | 1697 | if(!setlocale(LC_CTYPE, "") || !XSupportsLocale()) |
| 1716 | fprintf(stderr, "warning: no locale support\n"); | 1698 | fputs("warning: no locale support\n", stderr); |
| 1717 | 1699 | ||
| 1718 | if(!(dpy = XOpenDisplay(0))) | 1700 | if(!(dpy = XOpenDisplay(0))) |
| 1719 | die("dwm: cannot open display\n"); | 1701 | die("dwm: cannot open display\n"); |
