summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora@null <unknown>2008-12-17 21:25:32 +0000
committera@null <unknown>2008-12-17 21:25:32 +0000
commitbe39dddcc5bad25e0e1430228e196c3837f1c3e7 (patch)
treed48b86e2b77110901437aae128263270227ec8a4
parentmade status script example of .xinitrc more useful (diff)
downloaddwm-be39dddcc5bad25e0e1430228e196c3837f1c3e7.tar.gz
dwm-be39dddcc5bad25e0e1430228e196c3837f1c3e7.zip
implemented noborder for 1 client in the view
Diffstat (limited to '')
-rw-r--r--dwm.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/dwm.c b/dwm.c
index 378fde5..489ba80 100644
--- a/dwm.c
+++ b/dwm.c
@@ -128,6 +128,7 @@ typedef struct {
128} Rule; 128} Rule;
129 129
130/* function declarations */ 130/* function declarations */
131static void adjustborder(Client *c, Bool issingle);
131static void applyrules(Client *c); 132static void applyrules(Client *c);
132static void arrange(void); 133static void arrange(void);
133static void attach(Client *c); 134static void attach(Client *c);
@@ -245,6 +246,17 @@ struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1
245 246
246/* function implementations */ 247/* function implementations */
247void 248void
249adjustborder(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
259void
248applyrules(Client *c) { 260applyrules(Client *c) {
249 unsigned int i; 261 unsigned int i;
250 Rule *r; 262 Rule *r;
@@ -924,10 +936,14 @@ maprequest(XEvent *e) {
924 936
925void 937void
926monocle(void) { 938monocle(void) {
939 unsigned int n;
927 Client *c; 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 resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, resizehints); 945 resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, resizehints);
946 }
931} 947}
932 948
933void 949void
@@ -1330,6 +1346,7 @@ showhide(Client *c) {
1330 if(!c) 1346 if(!c)
1331 return; 1347 return;
1332 if(ISVISIBLE(c)) { /* show clients top down */ 1348 if(ISVISIBLE(c)) { /* show clients top down */
1349 adjustborder(c, False);
1333 XMoveWindow(dpy, c->win, c->x, c->y); 1350 XMoveWindow(dpy, c->win, c->x, c->y);
1334 if(!lt[sellt]->arrange || c->isfloating) 1351 if(!lt[sellt]->arrange || c->isfloating)
1335 resize(c, c->x, c->y, c->w, c->h, True); 1352 resize(c, c->x, c->y, c->w, c->h, True);
@@ -1393,6 +1410,7 @@ tile(void) {
1393 /* master */ 1410 /* master */
1394 c = nexttiled(clients); 1411 c = nexttiled(clients);
1395 mw = mfact * ww; 1412 mw = mfact * ww;
1413 adjustborder(c, n == 1);
1396 resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints); 1414 resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints);
1397 1415
1398 if(--n == 0) 1416 if(--n == 0)
@@ -1407,6 +1425,7 @@ tile(void) {
1407 h = wh; 1425 h = wh;
1408 1426
1409 for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { 1427 for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
1428 adjustborder(c, False);
1410 resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) 1429 resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
1411 ? wy + wh - y - 2 * c->bw : h - 2 * c->bw), resizehints); 1430 ? wy + wh - y - 2 * c->bw : h - 2 * c->bw), resizehints);
1412 if(h != wh) 1431 if(h != wh)