about summary refs log tree commit diff stats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-14 10:07:38 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-14 10:07:38 +0200
commit9cd686c93a80b4095d4ee0960bef320ccd9ea02c (patch)
tree5bc29a58baac6bd0d241a3e923380efe1d7b5f8f /client.c
parent1549faf3b93f77aee08e7aad12c75f6b6ca4c058 (diff)
downloaddwm-9cd686c93a80b4095d4ee0960bef320ccd9ea02c.tar.gz
implemented bar for dwm (I miss status text), I plan that status text is read from stdin in dwm
Diffstat (limited to 'client.c')
-rw-r--r--client.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/client.c b/client.c
index e9075a2..e0ab719 100644
--- a/client.c
+++ b/client.c
@@ -49,9 +49,9 @@ max(Arg *arg)
 	if(!sel)
 		return;
 	sel->x = sx;
-	sel->y = sy;
+	sel->y = sy + bh;
 	sel->w = sw - 2 * sel->border;
-	sel->h = sh - 2 * sel->border;
+	sel->h = sh - 2 * sel->border - bh;
 	craise(sel);
 	resize(sel, False);
 	discard_events(EnterWindowMask);
@@ -67,6 +67,7 @@ view(Arg *arg)
 
 	for(c = clients; c; c = next(c->next))
 		draw_client(c);
+	draw_bar();
 }
 
 void
@@ -131,7 +132,10 @@ tiling(Arg *arg)
 		if(c->tags[tsel] && !c->floating)
 			n++;
 
-	h = (n > 1) ? sh / (n - 1) : sh;
+	if(n > 1)
+		h = (sh - bh) / (n - 1);
+	else
+		h = sh - bh;
 
 	for(i = 0, c = clients; c; c = c->next) {
 		if(c->tags[tsel]) {
@@ -142,19 +146,19 @@ tiling(Arg *arg)
 			}
 			if(n == 1) {
 				c->x = sx;
-				c->y = sy;
+				c->y = sy + bh;
 				c->w = sw - 2 * c->border;
-				c->h = sh - 2 * c->border;
+				c->h = sh - 2 * c->border - bh;
 			}
 			else if(i == 0) {
 				c->x = sx;
-				c->y = sy;
+				c->y = sy + bh;
 				c->w = mw - 2 * c->border;
-				c->h = sh - 2 * c->border;
+				c->h = sh - 2 * c->border - bh;
 			}
 			else {
 				c->x = sx + mw;
-				c->y = sy + (i - 1) * h;
+				c->y = sy + (i - 1) * h + bh;
 				c->w = w - 2 * c->border;
 				c->h = h - 2 * c->border;
 			}
@@ -373,9 +377,11 @@ manage(Window w, XWindowAttributes *wa)
 	c->win = w;
 	c->tx = c->x = wa->x;
 	c->ty = c->y = wa->y;
+	if(c->y < bh)
+		c->ty = c->y += bh;
 	c->tw = c->w = wa->width;
 	c->h = wa->height;
-	c->th = th;
+	c->th = bh;
 	c->border = 1;
 	c->proto = win_proto(c->win);
 	update_size(c);
@@ -570,6 +576,7 @@ draw_client(Client *c)
 {
 	int i;
 	if(c == sel) {
+		draw_bar();
 		XUnmapWindow(dpy, c->title);
 		XSetWindowBorder(dpy, c->win, dc.fg);
 		return;
@@ -579,19 +586,18 @@ draw_client(Client *c)
 	XMapWindow(dpy, c->title);
 
 	dc.x = dc.y = 0;
-	dc.h = c->th;
 
 	dc.w = 0;
 	for(i = 0; i < TLast; i++) {
 		if(c->tags[i]) {
 			dc.x += dc.w;
 			dc.w = textw(c->tags[i]) + dc.font.height;
-			draw(True, c->tags[i]);
+			drawtext(c->tags[i], True);
 		}
 	}
 	dc.x += dc.w;
 	dc.w = textw(c->name) + dc.font.height;
-	draw(True, c->name);
+	drawtext(c->name, True);
 	XCopyArea(dpy, dc.drawable, c->title, dc.gc,
 			0, 0, c->tw, c->th, 0, 0);
 	XFlush(dpy);
@wmii.de> 2006-07-10 22:16:48 +0200 committer Anselm R. Garbe <garbeam@wmii.de> 2006-07-10 22:16:48 +0200 added several other stuff' href='/acidbong/suckless/dwm/commit/wm.h?h=2.5&id=439e15d09f6fa9271d3b49ef97194f0c80ebe161'>439e15d ^
1076f2b

366d81e ^


586f663 ^

366d81e ^

1076f2b
439e15d ^
3399650 ^
1076f2b
439e15d ^
3399650 ^
439e15d ^
1076f2b
3399650 ^
d6e0e6e ^
39677ec ^

3399650 ^
39677ec ^
439e15d ^


366d81e ^
586f663 ^


366d81e ^
439e15d ^
0053620 ^
3399650 ^



d6e0e6e ^
b9da4b0 ^
3399650 ^

b9da4b0 ^
439e15d ^
366d81e ^

16c67f3 ^
366d81e ^
b9da4b0 ^



1076f2b
0053620 ^
3399650 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93