aewl

diff client.c @ 500:d5ad819f2a66

fixing the settags issue, preparing 1.7.1
author Anselm R. Garbe <arg@10kloc.org>
date Wed, 27 Sep 2006 17:18:46 +0200
parents 12395ef46d97
children 9aa3d06199cb
line diff
     1.1 --- a/client.c	Tue Sep 26 17:42:14 2006 +0200
     1.2 +++ b/client.c	Wed Sep 27 17:18:46 2006 +0200
     1.3 @@ -54,19 +54,6 @@
     1.4  				GrabModeAsync, GrabModeSync, None, None);
     1.5  }
     1.6  
     1.7 -static void
     1.8 -resizetitle(Client *c) {
     1.9 -	c->tw = textw(c->name);
    1.10 -	if(c->tw > c->w)
    1.11 -		c->tw = c->w + 2;
    1.12 -	c->tx = c->x + c->w - c->tw + 2;
    1.13 -	c->ty = c->y;
    1.14 -	if(isvisible(c))
    1.15 -		XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
    1.16 -	else
    1.17 -		XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th);
    1.18 -}
    1.19 -
    1.20  static int
    1.21  xerrordummy(Display *dsply, XErrorEvent *ee) {
    1.22  	return 0;
    1.23 @@ -250,11 +237,13 @@
    1.24  			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
    1.25  
    1.26  	grabbuttons(c, False);
    1.27 +	updatetitle(c);
    1.28  	settags(c, getclient(trans));
    1.29  	if(!c->isfloat)
    1.30  		c->isfloat = trans
    1.31  			|| (c->maxw && c->minw &&
    1.32  				c->maxw == c->minw && c->maxh == c->minh);
    1.33 +	resizetitle(c);
    1.34  
    1.35  	if(clients)
    1.36  		clients->prev = c;
    1.37 @@ -262,7 +251,6 @@
    1.38  	c->snext = stack;
    1.39  	stack = clients = c;
    1.40  
    1.41 -	updatetitle(c);
    1.42  	ban(c);
    1.43  	XMapWindow(dpy, c->win);
    1.44  	XMapWindow(dpy, c->twin);
    1.45 @@ -321,6 +309,19 @@
    1.46  }
    1.47  
    1.48  void
    1.49 +resizetitle(Client *c) {
    1.50 +	c->tw = textw(c->name);
    1.51 +	if(c->tw > c->w)
    1.52 +		c->tw = c->w + 2;
    1.53 +	c->tx = c->x + c->w - c->tw + 2;
    1.54 +	c->ty = c->y;
    1.55 +	if(isvisible(c))
    1.56 +		XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
    1.57 +	else
    1.58 +		XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th);
    1.59 +}
    1.60 +
    1.61 +void
    1.62  updatesize(Client *c) {
    1.63  	long msize;
    1.64  	XSizeHints size;
    1.65 @@ -382,7 +383,6 @@
    1.66  		}
    1.67  	}
    1.68  	XFree(name.value);
    1.69 -	resizetitle(c);
    1.70  }
    1.71  
    1.72  void