dwm-meillo

changeset 728:295c8ca7a27a

applied apm's patch proposal, getting rid of XDrawLines
author Anselm R. Garbe <arg@suckless.org>
date Mon, 05 Feb 2007 11:05:16 +0100
parents 1a1f8a7e6729
children 9c3bf42bdbf4
files draw.c
diffstat 1 files changed, 4 insertions(+), 14 deletions(-) [+]
line diff
     1.1 --- a/draw.c	Thu Feb 01 08:23:00 2007 +0100
     1.2 +++ b/draw.c	Mon Feb 05 11:05:16 2007 +0100
     1.3 @@ -35,7 +35,6 @@
     1.4  	unsigned int len, olen;
     1.5  	XGCValues gcv;
     1.6  	XRectangle r = { dc.x, dc.y, dc.w, dc.h };
     1.7 -	XPoint pt[5];
     1.8  
     1.9  	XSetForeground(dpy, dc.gc, col[ColBG]);
    1.10  	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.11 @@ -74,24 +73,15 @@
    1.12  		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
    1.13  	}
    1.14  	x = (h + 2) / 4;
    1.15 +	r.x = dc.x + 1;
    1.16 +	r.y = dc.y + 1;
    1.17  	if(filledsquare) {
    1.18 -		r.x = dc.x + 1;
    1.19 -		r.y = dc.y + 1;
    1.20  		r.width = r.height = x + 1;
    1.21  		XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.22  	}
    1.23  	else if(emptysquare) {
    1.24 -		pt[0].x = dc.x + 1;
    1.25 -		pt[0].y = dc.y + 1;
    1.26 -		pt[1].x = x;
    1.27 -		pt[1].y = 0;
    1.28 -		pt[2].x = 0;
    1.29 -		pt[2].y = x;
    1.30 -		pt[3].x = -x;
    1.31 -		pt[3].y = 0;
    1.32 -		pt[4].x = 0;
    1.33 -		pt[4].y = -x;
    1.34 -		XDrawLines(dpy, dc.drawable, dc.gc, pt, 5, CoordModePrevious);
    1.35 +		r.width = r.height = x;
    1.36 +		XDrawRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.37  	}
    1.38  }
    1.39