aewl

diff client.c @ 342:a1901753deef

updated man page
author Anselm R. Garbe <arg@10kloc.org>
date Wed, 23 Aug 2006 18:50:46 +0200
parents 96d09fd98e89
children a9b4077ec058
line diff
     1.1 --- a/client.c	Wed Aug 23 14:40:44 2006 +0200
     1.2 +++ b/client.c	Wed Aug 23 18:50:46 2006 +0200
     1.3 @@ -28,19 +28,15 @@
     1.4  {
     1.5  	int i;
     1.6  
     1.7 -	c->tw = 0;
     1.8 -	for(i = 0; i < ntags; i++)
     1.9 -		if(c->tags[i])
    1.10 -			c->tw += textw(tags[i]);
    1.11 -	c->tw += textw(c->name);
    1.12 +	c->tw = textw(c->name);
    1.13  	if(c->tw > c->w)
    1.14  		c->tw = c->w + 2;
    1.15  	c->tx = c->x + c->w - c->tw + 2;
    1.16  	c->ty = c->y;
    1.17  	if(isvisible(c))
    1.18 -		XMoveResizeWindow(dpy, c->title, c->tx, c->ty, c->tw, c->th);
    1.19 +		XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
    1.20  	else
    1.21 -		XMoveResizeWindow(dpy, c->title, c->tx + 2 * sw, c->ty, c->tw, c->th);
    1.22 +		XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th);
    1.23  
    1.24  }
    1.25  
    1.26 @@ -65,7 +61,7 @@
    1.27  ban(Client *c)
    1.28  {
    1.29  	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
    1.30 -	XMoveWindow(dpy, c->title, c->tx + 2 * sw, c->ty);
    1.31 +	XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty);
    1.32  }
    1.33  
    1.34  void
    1.35 @@ -106,7 +102,7 @@
    1.36  	Client *c;
    1.37  
    1.38  	for(c = clients; c; c = c->next)
    1.39 -		if(c->title == w)
    1.40 +		if(c->twin == w)
    1.41  			return c;
    1.42  	return NULL;
    1.43  }
    1.44 @@ -214,7 +210,7 @@
    1.45  	twa.background_pixmap = ParentRelative;
    1.46  	twa.event_mask = ExposureMask | EnterWindowMask;
    1.47  
    1.48 -	c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th,
    1.49 +	c->twin = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th,
    1.50  			0, DefaultDepth(dpy, screen), CopyFromParent,
    1.51  			DefaultVisual(dpy, screen),
    1.52  			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
    1.53 @@ -242,7 +238,7 @@
    1.54  		sel = c;
    1.55  	arrange(NULL);
    1.56  	XMapWindow(dpy, c->win);
    1.57 -	XMapWindow(dpy, c->title);
    1.58 +	XMapWindow(dpy, c->twin);
    1.59  	if(isvisible(c))
    1.60  		focus(c);
    1.61  }
    1.62 @@ -329,7 +325,7 @@
    1.63  settitle(Client *c)
    1.64  {
    1.65  	char **list = NULL;
    1.66 -	int n;
    1.67 +	int i, n;
    1.68  	XTextProperty name;
    1.69  
    1.70  	name.nitems = 0;
    1.71 @@ -392,7 +388,7 @@
    1.72  	XSetErrorHandler(xerrordummy);
    1.73  
    1.74  	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
    1.75 -	XDestroyWindow(dpy, c->title);
    1.76 +	XDestroyWindow(dpy, c->twin);
    1.77  
    1.78  	if(c->prev)
    1.79  		c->prev->next = c->next;