aewl

diff client.c @ 123:61490330e90a

cleaned up code
author arg@10ksloc.org
date Thu, 20 Jul 2006 12:18:06 +0200
parents 329fd7dae530
children 75576e44c1d8
line diff
     1.1 --- a/client.c	Thu Jul 20 10:48:22 2006 +0200
     1.2 +++ b/client.c	Thu Jul 20 12:18:06 2006 +0200
     1.3 @@ -97,6 +97,7 @@
     1.4  getclient(Window w)
     1.5  {
     1.6  	Client *c;
     1.7 +
     1.8  	for(c = clients; c; c = c->next)
     1.9  		if(c->win == w)
    1.10  			return c;
    1.11 @@ -107,6 +108,7 @@
    1.12  getctitle(Window w)
    1.13  {
    1.14  	Client *c;
    1.15 +
    1.16  	for(c = clients; c; c = c->next)
    1.17  		if(c->title == w)
    1.18  			return c;
    1.19 @@ -198,8 +200,8 @@
    1.20  {
    1.21  	int diff;
    1.22  	Client *c;
    1.23 +	Window trans;
    1.24  	XSetWindowAttributes twa;
    1.25 -	Window trans;
    1.26  
    1.27  	c = emallocz(sizeof(Client));
    1.28  	c->win = w;
    1.29 @@ -278,6 +280,7 @@
    1.30  pop(Client *c)
    1.31  {
    1.32  	Client **l;
    1.33 +
    1.34  	for(l = &clients; *l && *l != c; l = &(*l)->next);
    1.35  	*l = c->next;
    1.36  
    1.37 @@ -289,9 +292,9 @@
    1.38  void
    1.39  resize(Client *c, Bool inc, Corner sticky)
    1.40  {
    1.41 +	int bottom = c->y + c->h;
    1.42 +	int right = c->x + c->w;
    1.43  	XConfigureEvent e;
    1.44 -	int right = c->x + c->w;
    1.45 -	int bottom = c->y + c->h;
    1.46  
    1.47  	if(inc) {
    1.48  		if(c->incw)
    1.49 @@ -337,8 +340,9 @@
    1.50  void
    1.51  setsize(Client *c)
    1.52  {
    1.53 +	long msize;
    1.54  	XSizeHints size;
    1.55 -	long msize;
    1.56 +
    1.57  	if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
    1.58  		size.flags = PSize;
    1.59  	c->flags = size.flags;
    1.60 @@ -375,9 +379,9 @@
    1.61  void
    1.62  settitle(Client *c)
    1.63  {
    1.64 +	char **list = NULL;
    1.65 +	int n;
    1.66  	XTextProperty name;
    1.67 -	int n;
    1.68 -	char **list = NULL;
    1.69  
    1.70  	name.nitems = 0;
    1.71  	c->name[0] = 0;