about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-15 12:04:25 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-15 12:04:25 +0100
commitf8181f64e2ba4fca4e85036c48cf90a2151794fc (patch)
tree7d82e76b3214ca5e09a25ce8e68f1fbf1491c138
parent0045ad87dfb32f35fc17b5b8942049cfe84d623c (diff)
downloaddwm-f8181f64e2ba4fca4e85036c48cf90a2151794fc.tar.gz
removed drawclient and drawall (they performed useless operations/consumed useless cpu cycles)
-rw-r--r--client.c5
-rw-r--r--draw.c20
-rw-r--r--dwm.h2
-rw-r--r--event.c8
-rw-r--r--view.c1
5 files changed, 6 insertions, 30 deletions
diff --git a/client.c b/client.c
index af13797..b122427 100644
--- a/client.c
+++ b/client.c
@@ -90,7 +90,7 @@ focus(Client *c) {
 		sel = c;
 		if(old) {
 			grabbuttons(old, False);
-			drawclient(old);
+			XSetWindowBorder(dpy, old->win, dc.norm[ColBorder]);
 		}
 	}
 	if(c) {
@@ -98,11 +98,12 @@ focus(Client *c) {
 		c->snext = stack;
 		stack = c;
 		grabbuttons(c, True);
-		drawclient(c);
+		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
 		XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
 	}
 	else
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+	drawstatus();
 }
 
 Client *
diff --git a/draw.c b/draw.c
index 19604f3..fe2951c 100644
--- a/draw.c
+++ b/draw.c
@@ -98,15 +98,6 @@ drawtext(const char *text, unsigned long col[ColLast], Bool filledsquare, Bool e
 /* extern */
 
 void
-drawall(void) {
-	Client *c;
-
-	for(c = clients; c; c = getnext(c->next))
-		drawclient(c);
-	drawstatus();
-}
-
-void
 drawstatus(void) {
 	int i, x;
 
@@ -137,17 +128,6 @@ drawstatus(void) {
 	XSync(dpy, False);
 }
 
-void
-drawclient(Client *c) {
-	if(c == sel && issel) {
-		drawstatus();
-		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
-		return;
-	}
-	XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
-	XSync(dpy, False);
-}
-
 unsigned long
 getcolor(const char *colstr) {
 	Colormap cmap = DefaultColormap(dpy, screen);
diff --git a/dwm.h b/dwm.h
index 3789373..03f8c1f 100644
--- a/dwm.h
+++ b/dwm.h
@@ -117,9 +117,7 @@ extern void updatetitle(Client *c);		/* update the name of c */
 extern void unmanage(Client *c);		/* destroy c */
 
 /* draw.c */
-extern void drawall(void);			/* draw all visible client titles and the bar */
 extern void drawstatus(void);			/* draw the bar */
-extern void drawclient(Client *c);		/* draw title and set border of c */
 extern unsigned long getcolor(const char *colstr);	/* return color of colstr */
 extern void setfont(const char *fontstr);	/* set the font for DC */
 extern unsigned int textw(const char *text);	/* return the width of text in px*/
diff --git a/event.c b/event.c
index a9d2fbb..a809511 100644
--- a/event.c
+++ b/event.c
@@ -235,7 +235,6 @@ enternotify(XEvent *e) {
 	else if(ev->window == root) {
 		issel = True;
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
-		drawall();
 	}
 }
 
@@ -272,10 +271,8 @@ static void
 leavenotify(XEvent *e) {
 	XCrossingEvent *ev = &e->xcrossing;
 
-	if((ev->window == root) && !ev->same_screen) {
+	if((ev->window == root) && !ev->same_screen)
 		issel = False;
-		drawall();
-	}
 }
 
 static void
@@ -329,7 +326,8 @@ propertynotify(XEvent *e) {
 		}
 		if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
 			updatetitle(c);
-			drawclient(c);
+			if(c == sel)
+				drawstatus();
 		}
 	}
 }
diff --git a/view.c b/view.c
index 935525f..bc1f4e2 100644
--- a/view.c
+++ b/view.c
@@ -200,7 +200,6 @@ restack(void) {
 			XLowerWindow(dpy, c->win);
 		}
 	}
-	drawall();
 	XSync(dpy, False);
 	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }
:34:02 +0100 readme: updated' href='/akspecs/ranger/commit/README?h=v1.9.2&id=36e4e71ee5643fc0b2c501956086434389ec5384'>36e4e71e ^
4ea0f69a ^

36e4e71e ^
bd088c49 ^
36e4e71e ^
0a32b684 ^
36e4e71e ^

f6ae504c ^
4ea0f69a ^

0a32b684 ^

4ea0f69a ^
0a32b684 ^
4ea0f69a ^


0a32b684 ^

4ea0f69a ^



36e4e71e ^
7582555b ^
36e4e71e ^
7582555b ^








36e4e71e ^
4ea0f69a ^


36e4e71e ^




4ea0f69a ^
e71c8103 ^

36e4e71e ^

f6ae504c ^
4ea0f69a ^
36e4e71e ^

4ea0f69a ^

36e4e71e ^






4ea0f69a ^

306c76d8 ^






b6aff4c3 ^

306c76d8 ^
4ea0f69a ^

45cf5174 ^












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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137