summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client.c4
-rw-r--r--config.mk2
-rw-r--r--draw.c1
-rw-r--r--event.c8
-rw-r--r--util.c5
-rw-r--r--wm.c5
6 files changed, 13 insertions, 12 deletions
diff --git a/client.c b/client.c
index e9b83fe..95ec3a6 100644
--- a/client.c
+++ b/client.c
@@ -44,8 +44,8 @@ arrange(void *aux)
44 else 44 else
45 cols = rows; 45 cols = rows;
46 46
47 gw = (sw - 2 * c->border) / cols; 47 gw = (sw - 2) / cols;
48 gh = (sh - bh - 2 * c->border) / rows; 48 gh = (sh - bh - 2) / rows;
49 49
50 for(i = j = 0, c = clients; c; c = c->next) { 50 for(i = j = 0, c = clients; c; c = c->next) {
51 c->x = i * gw; 51 c->x = i * gw;
diff --git a/config.mk b/config.mk
index 0e5d372..41cb070 100644
--- a/config.mk
+++ b/config.mk
@@ -14,7 +14,7 @@ VERSION = 0.0
14LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11 14LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11
15 15
16# Linux/BSD 16# Linux/BSD
17CFLAGS = -g -Wall -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ 17CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
18 -DVERSION=\"${VERSION}\" 18 -DVERSION=\"${VERSION}\"
19LDFLAGS = -g ${LIBS} 19LDFLAGS = -g ${LIBS}
20 20
diff --git a/draw.c b/draw.c
index c148362..68ece01 100644
--- a/draw.c
+++ b/draw.c
@@ -39,6 +39,7 @@ draw(Display *dpy, Brush *b, Bool border, const char *text)
39 XSetForeground(dpy, b->gc, b->bg); 39 XSetForeground(dpy, b->gc, b->bg);
40 XFillRectangles(dpy, b->drawable, b->gc, &r, 1); 40 XFillRectangles(dpy, b->drawable, b->gc, &r, 1);
41 41
42 w = 0;
42 if(border) 43 if(border)
43 drawborder(dpy, b); 44 drawborder(dpy, b);
44 45
diff --git a/event.c b/event.c
index 93007df..37196d1 100644
--- a/event.c
+++ b/event.c
@@ -186,11 +186,11 @@ propertynotify(XEvent *e)
186 if(ev->state == PropertyDelete) 186 if(ev->state == PropertyDelete)
187 return; /* ignore */ 187 return; /* ignore */
188 188
189 if(ev->atom == wm_atom[WMProtocols]) {
190 c->proto = win_proto(c->win);
191 return;
192 }
193 if((c = getclient(ev->window))) { 189 if((c = getclient(ev->window))) {
190 if(ev->atom == wm_atom[WMProtocols]) {
191 c->proto = win_proto(c->win);
192 return;
193 }
194 switch (ev->atom) { 194 switch (ev->atom) {
195 default: break; 195 default: break;
196 case XA_WM_TRANSIENT_FOR: 196 case XA_WM_TRANSIENT_FOR:
diff --git a/util.c b/util.c
index 9da8f52..3f41b3c 100644
--- a/util.c
+++ b/util.c
@@ -126,13 +126,14 @@ pipe_spawn(char *buf, unsigned int len, Display *dpy, char *argv[])
126 perror(" failed"); 126 perror(" failed");
127 } 127 }
128 else { 128 else {
129 n = 0; 129 l = n = 0;
130 close(pfd[1]); 130 close(pfd[1]);
131 while(l > n) { 131 while(n < len) {
132 if((l = read(pfd[0], buf + n, len - n)) < 1) 132 if((l = read(pfd[0], buf + n, len - n)) < 1)
133 break; 133 break;
134 n += l; 134 n += l;
135 } 135 }
136 while(l > n);
136 close(pfd[0]); 137 close(pfd[0]);
137 buf[n < len ? n : len - 1] = 0; 138 buf[n < len ? n : len - 1] = 0;
138 } 139 }
diff --git a/wm.c b/wm.c
index 02b9a68..ed40a8b 100644
--- a/wm.c
+++ b/wm.c
@@ -95,13 +95,12 @@ win_property(Window w, Atom a, Atom t, long l, unsigned char **prop)
95int 95int
96win_proto(Window w) 96win_proto(Window w)
97{ 97{
98 Atom *protocols; 98 unsigned char *protocols;
99 long res; 99 long res;
100 int protos = 0; 100 int protos = 0;
101 int i; 101 int i;
102 102
103 res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L, 103 res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L, &protocols);
104 ((unsigned char **) &protocols));
105 if(res <= 0) { 104 if(res <= 0) {
106 return protos; 105 return protos;
107 } 106 }