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
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 diff
     1.1 --- a/client.c	Wed Jul 12 17:17:15 2006 +0200
     1.2 +++ b/client.c	Wed Jul 12 17:50:31 2006 +0200
     1.3 @@ -44,8 +44,8 @@
     1.4  	else
     1.5  		cols = rows;
     1.6  
     1.7 -	gw = (sw - 2 * c->border)  / cols;
     1.8 -	gh = (sh - bh - 2 * c->border) / rows;
     1.9 +	gw = (sw - 2)  / cols;
    1.10 +	gh = (sh - bh - 2) / rows;
    1.11  
    1.12  	for(i = j = 0, c = clients; c; c = c->next) {
    1.13  		c->x = i * gw;
     2.1 --- a/config.mk	Wed Jul 12 17:17:15 2006 +0200
     2.2 +++ b/config.mk	Wed Jul 12 17:50:31 2006 +0200
     2.3 @@ -14,7 +14,7 @@
     2.4  LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11
     2.5  
     2.6  # Linux/BSD
     2.7 -CFLAGS = -g -Wall -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
     2.8 +CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
     2.9  	-DVERSION=\"${VERSION}\"
    2.10  LDFLAGS = -g ${LIBS}
    2.11  
     3.1 --- a/draw.c	Wed Jul 12 17:17:15 2006 +0200
     3.2 +++ b/draw.c	Wed Jul 12 17:50:31 2006 +0200
     3.3 @@ -39,6 +39,7 @@
     3.4  	XSetForeground(dpy, b->gc, b->bg);
     3.5  	XFillRectangles(dpy, b->drawable, b->gc, &r, 1);
     3.6  
     3.7 +	w = 0;
     3.8  	if(border)
     3.9  		drawborder(dpy, b);
    3.10  
     4.1 --- a/event.c	Wed Jul 12 17:17:15 2006 +0200
     4.2 +++ b/event.c	Wed Jul 12 17:50:31 2006 +0200
     4.3 @@ -186,11 +186,11 @@
     4.4  	if(ev->state == PropertyDelete)
     4.5  		return; /* ignore */
     4.6  
     4.7 -	if(ev->atom == wm_atom[WMProtocols]) {
     4.8 -		c->proto = win_proto(c->win);
     4.9 -		return;
    4.10 -	}
    4.11  	if((c = getclient(ev->window))) {
    4.12 +		if(ev->atom == wm_atom[WMProtocols]) {
    4.13 +			c->proto = win_proto(c->win);
    4.14 +			return;
    4.15 +		}
    4.16  		switch (ev->atom) {
    4.17  			default: break;
    4.18  			case XA_WM_TRANSIENT_FOR:
     5.1 --- a/util.c	Wed Jul 12 17:17:15 2006 +0200
     5.2 +++ b/util.c	Wed Jul 12 17:50:31 2006 +0200
     5.3 @@ -126,13 +126,14 @@
     5.4  		perror(" failed");
     5.5  	}
     5.6  	else {
     5.7 -		n = 0;
     5.8 +		l = n = 0;
     5.9  		close(pfd[1]);
    5.10 -		while(l > n) {
    5.11 +		while(n < len) {
    5.12  			if((l = read(pfd[0], buf + n, len - n)) < 1)
    5.13  				break;
    5.14  			n += l;
    5.15  		}
    5.16 +		while(l > n);
    5.17  		close(pfd[0]);
    5.18  		buf[n < len ? n : len - 1] = 0;
    5.19  	}
     6.1 --- a/wm.c	Wed Jul 12 17:17:15 2006 +0200
     6.2 +++ b/wm.c	Wed Jul 12 17:50:31 2006 +0200
     6.3 @@ -95,13 +95,12 @@
     6.4  int
     6.5  win_proto(Window w)
     6.6  {
     6.7 -	Atom *protocols;
     6.8 +	unsigned char *protocols;
     6.9  	long res;
    6.10  	int protos = 0;
    6.11  	int i;
    6.12  
    6.13 -	res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L,
    6.14 -			((unsigned char **) &protocols));
    6.15 +	res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L, &protocols);
    6.16  	if(res <= 0) {
    6.17  		return protos;
    6.18  	}