diff options
Diffstat (limited to '')
| -rw-r--r-- | client.c | 4 | ||||
| -rw-r--r-- | config.mk | 2 | ||||
| -rw-r--r-- | draw.c | 1 | ||||
| -rw-r--r-- | event.c | 8 | ||||
| -rw-r--r-- | util.c | 5 | ||||
| -rw-r--r-- | wm.c | 5 |
6 files changed, 13 insertions, 12 deletions
| @@ -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; |
| @@ -14,7 +14,7 @@ VERSION = 0.0 | |||
| 14 | LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11 | 14 | LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11 |
| 15 | 15 | ||
| 16 | # Linux/BSD | 16 | # Linux/BSD |
| 17 | CFLAGS = -g -Wall -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ | 17 | CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ |
| 18 | -DVERSION=\"${VERSION}\" | 18 | -DVERSION=\"${VERSION}\" |
| 19 | LDFLAGS = -g ${LIBS} | 19 | LDFLAGS = -g ${LIBS} |
| 20 | 20 | ||
| @@ -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 | ||
| @@ -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: |
| @@ -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 | } |
| @@ -95,13 +95,12 @@ win_property(Window w, Atom a, Atom t, long l, unsigned char **prop) | |||
| 95 | int | 95 | int |
| 96 | win_proto(Window w) | 96 | win_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 | } |
