implemented noborder for 1 client in the view
be39dddc
1 file(s) · +20 −1
| 128 | 128 | } Rule; |
|
| 129 | 129 | ||
| 130 | 130 | /* function declarations */ |
|
| 131 | + | static void adjustborder(Client *c, Bool issingle); |
|
| 131 | 132 | static void applyrules(Client *c); |
|
| 132 | 133 | static void arrange(void); |
|
| 133 | 134 | static void attach(Client *c); |
|
| 244 | 245 | struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1 : 1]; }; |
|
| 245 | 246 | ||
| 246 | 247 | /* function implementations */ |
|
| 248 | + | void |
|
| 249 | + | adjustborder(Client *c, Bool issingle) { |
|
| 250 | + | XWindowChanges wc; |
|
| 251 | + | ||
| 252 | + | wc.border_width = issingle ? 0 : borderpx; |
|
| 253 | + | if(c->bw != wc.border_width) { |
|
| 254 | + | c->bw = wc.border_width; |
|
| 255 | + | XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); |
|
| 256 | + | } |
|
| 257 | + | } |
|
| 258 | + | ||
| 247 | 259 | void |
|
| 248 | 260 | applyrules(Client *c) { |
|
| 249 | 261 | unsigned int i; |
|
| 924 | 936 | ||
| 925 | 937 | void |
|
| 926 | 938 | monocle(void) { |
|
| 939 | + | unsigned int n; |
|
| 927 | 940 | Client *c; |
|
| 928 | 941 | ||
| 929 | - | for(c = nexttiled(clients); c; c = nexttiled(c->next)) |
|
| 942 | + | for(n = 0, c = nexttiled(clients); c && n < 2; c = nexttiled(c->next), n++); |
|
| 943 | + | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { |
|
| 944 | + | adjustborder(c, n == 1); |
|
| 930 | 945 | resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, resizehints); |
|
| 946 | + | } |
|
| 931 | 947 | } |
|
| 932 | 948 | ||
| 933 | 949 | void |
|
| 1330 | 1346 | if(!c) |
|
| 1331 | 1347 | return; |
|
| 1332 | 1348 | if(ISVISIBLE(c)) { /* show clients top down */ |
|
| 1349 | + | adjustborder(c, False); |
|
| 1333 | 1350 | XMoveWindow(dpy, c->win, c->x, c->y); |
|
| 1334 | 1351 | if(!lt[sellt]->arrange || c->isfloating) |
|
| 1335 | 1352 | resize(c, c->x, c->y, c->w, c->h, True); |
|
| 1393 | 1410 | /* master */ |
|
| 1394 | 1411 | c = nexttiled(clients); |
|
| 1395 | 1412 | mw = mfact * ww; |
|
| 1413 | + | adjustborder(c, n == 1); |
|
| 1396 | 1414 | resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints); |
|
| 1397 | 1415 | ||
| 1398 | 1416 | if(--n == 0) |
|
| 1407 | 1425 | h = wh; |
|
| 1408 | 1426 | ||
| 1409 | 1427 | for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { |
|
| 1428 | + | adjustborder(c, False); |
|
| 1410 | 1429 | resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) |
|
| 1411 | 1430 | ? wy + wh - y - 2 * c->bw : h - 2 * c->bw), resizehints); |
|
| 1412 | 1431 | if(h != wh) |
|