aewl

changeset 690:399f08187c27

removed drawclient and drawall (they performed useless operations/consumed useless cpu cycles)
author Anselm R. Garbe <arg@suckless.org>
date Mon, 15 Jan 2007 12:04:25 +0100
parents cbec08a54a15
children 5d7e363f889d
files client.c draw.c dwm.h event.c view.c
diffstat 5 files changed, 6 insertions(+), 30 deletions(-) [+]
line diff
     1.1 --- a/client.c	Sun Jan 14 22:37:34 2007 +0100
     1.2 +++ b/client.c	Mon Jan 15 12:04:25 2007 +0100
     1.3 @@ -90,7 +90,7 @@
     1.4  		sel = c;
     1.5  		if(old) {
     1.6  			grabbuttons(old, False);
     1.7 -			drawclient(old);
     1.8 +			XSetWindowBorder(dpy, old->win, dc.norm[ColBorder]);
     1.9  		}
    1.10  	}
    1.11  	if(c) {
    1.12 @@ -98,11 +98,12 @@
    1.13  		c->snext = stack;
    1.14  		stack = c;
    1.15  		grabbuttons(c, True);
    1.16 -		drawclient(c);
    1.17 +		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
    1.18  		XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
    1.19  	}
    1.20  	else
    1.21  		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
    1.22 +	drawstatus();
    1.23  }
    1.24  
    1.25  Client *
     2.1 --- a/draw.c	Sun Jan 14 22:37:34 2007 +0100
     2.2 +++ b/draw.c	Mon Jan 15 12:04:25 2007 +0100
     2.3 @@ -98,15 +98,6 @@
     2.4  /* extern */
     2.5  
     2.6  void
     2.7 -drawall(void) {
     2.8 -	Client *c;
     2.9 -
    2.10 -	for(c = clients; c; c = getnext(c->next))
    2.11 -		drawclient(c);
    2.12 -	drawstatus();
    2.13 -}
    2.14 -
    2.15 -void
    2.16  drawstatus(void) {
    2.17  	int i, x;
    2.18  
    2.19 @@ -137,17 +128,6 @@
    2.20  	XSync(dpy, False);
    2.21  }
    2.22  
    2.23 -void
    2.24 -drawclient(Client *c) {
    2.25 -	if(c == sel && issel) {
    2.26 -		drawstatus();
    2.27 -		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
    2.28 -		return;
    2.29 -	}
    2.30 -	XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
    2.31 -	XSync(dpy, False);
    2.32 -}
    2.33 -
    2.34  unsigned long
    2.35  getcolor(const char *colstr) {
    2.36  	Colormap cmap = DefaultColormap(dpy, screen);
     3.1 --- a/dwm.h	Sun Jan 14 22:37:34 2007 +0100
     3.2 +++ b/dwm.h	Mon Jan 15 12:04:25 2007 +0100
     3.3 @@ -117,9 +117,7 @@
     3.4  extern void unmanage(Client *c);		/* destroy c */
     3.5  
     3.6  /* draw.c */
     3.7 -extern void drawall(void);			/* draw all visible client titles and the bar */
     3.8  extern void drawstatus(void);			/* draw the bar */
     3.9 -extern void drawclient(Client *c);		/* draw title and set border of c */
    3.10  extern unsigned long getcolor(const char *colstr);	/* return color of colstr */
    3.11  extern void setfont(const char *fontstr);	/* set the font for DC */
    3.12  extern unsigned int textw(const char *text);	/* return the width of text in px*/
     4.1 --- a/event.c	Sun Jan 14 22:37:34 2007 +0100
     4.2 +++ b/event.c	Mon Jan 15 12:04:25 2007 +0100
     4.3 @@ -235,7 +235,6 @@
     4.4  	else if(ev->window == root) {
     4.5  		issel = True;
     4.6  		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
     4.7 -		drawall();
     4.8  	}
     4.9  }
    4.10  
    4.11 @@ -272,10 +271,8 @@
    4.12  leavenotify(XEvent *e) {
    4.13  	XCrossingEvent *ev = &e->xcrossing;
    4.14  
    4.15 -	if((ev->window == root) && !ev->same_screen) {
    4.16 +	if((ev->window == root) && !ev->same_screen)
    4.17  		issel = False;
    4.18 -		drawall();
    4.19 -	}
    4.20  }
    4.21  
    4.22  static void
    4.23 @@ -329,7 +326,8 @@
    4.24  		}
    4.25  		if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
    4.26  			updatetitle(c);
    4.27 -			drawclient(c);
    4.28 +			if(c == sel)
    4.29 +				drawstatus();
    4.30  		}
    4.31  	}
    4.32  }
     5.1 --- a/view.c	Sun Jan 14 22:37:34 2007 +0100
     5.2 +++ b/view.c	Mon Jan 15 12:04:25 2007 +0100
     5.3 @@ -200,7 +200,6 @@
     5.4  			XLowerWindow(dpy, c->win);
     5.5  		}
     5.6  	}
     5.7 -	drawall();
     5.8  	XSync(dpy, False);
     5.9  	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    5.10  }