Mercurial > aewl
changeset 30:2e0fb4130bfb
new stuff, fixed several issues
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Wed, 12 Jul 2006 17:50:31 +0200 (2006-07-12) |
parents | 8ad86d0a6a53 |
children | 386649deb651 |
files | client.c config.mk draw.c event.c util.c wm.c |
diffstat | 6 files changed, 13 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/client.c Wed Jul 12 17:17:15 2006 +0200 +++ b/client.c Wed Jul 12 17:50:31 2006 +0200 @@ -44,8 +44,8 @@ else cols = rows; - gw = (sw - 2 * c->border) / cols; - gh = (sh - bh - 2 * c->border) / rows; + gw = (sw - 2) / cols; + gh = (sh - bh - 2) / rows; for(i = j = 0, c = clients; c; c = c->next) { c->x = i * gw;
--- a/config.mk Wed Jul 12 17:17:15 2006 +0200 +++ b/config.mk Wed Jul 12 17:50:31 2006 +0200 @@ -14,7 +14,7 @@ LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11 # Linux/BSD -CFLAGS = -g -Wall -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ +CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ -DVERSION=\"${VERSION}\" LDFLAGS = -g ${LIBS}
--- a/draw.c Wed Jul 12 17:17:15 2006 +0200 +++ b/draw.c Wed Jul 12 17:50:31 2006 +0200 @@ -39,6 +39,7 @@ XSetForeground(dpy, b->gc, b->bg); XFillRectangles(dpy, b->drawable, b->gc, &r, 1); + w = 0; if(border) drawborder(dpy, b);
--- a/event.c Wed Jul 12 17:17:15 2006 +0200 +++ b/event.c Wed Jul 12 17:50:31 2006 +0200 @@ -186,11 +186,11 @@ if(ev->state == PropertyDelete) return; /* ignore */ - if(ev->atom == wm_atom[WMProtocols]) { - c->proto = win_proto(c->win); - return; - } if((c = getclient(ev->window))) { + if(ev->atom == wm_atom[WMProtocols]) { + c->proto = win_proto(c->win); + return; + } switch (ev->atom) { default: break; case XA_WM_TRANSIENT_FOR:
--- a/util.c Wed Jul 12 17:17:15 2006 +0200 +++ b/util.c Wed Jul 12 17:50:31 2006 +0200 @@ -126,13 +126,14 @@ perror(" failed"); } else { - n = 0; + l = n = 0; close(pfd[1]); - while(l > n) { + while(n < len) { if((l = read(pfd[0], buf + n, len - n)) < 1) break; n += l; } + while(l > n); close(pfd[0]); buf[n < len ? n : len - 1] = 0; }
--- a/wm.c Wed Jul 12 17:17:15 2006 +0200 +++ b/wm.c Wed Jul 12 17:50:31 2006 +0200 @@ -95,13 +95,12 @@ int win_proto(Window w) { - Atom *protocols; + unsigned char *protocols; long res; int protos = 0; int i; - res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L, - ((unsigned char **) &protocols)); + res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L, &protocols); if(res <= 0) { return protos; }