aewl

diff client.c @ 158:4e42dfc0f61f

new resize stuff (using XConfigureWindow instead of XSendEvent)
author arg@10ksloc.org
date Wed, 02 Aug 2006 10:43:21 +0200
parents 93012e947eae
children a5eab6aaf859
line diff
     1.1 --- a/client.c	Tue Aug 01 16:44:23 2006 +0200
     1.2 +++ b/client.c	Wed Aug 02 10:43:21 2006 +0200
     1.3 @@ -271,7 +271,7 @@
     1.4  {
     1.5  	int bottom = c->y + c->h;
     1.6  	int right = c->x + c->w;
     1.7 -	XConfigureEvent e;
     1.8 +	XWindowChanges wc;
     1.9  
    1.10  	if(sizehints) {
    1.11  		if(c->incw)
    1.12 @@ -287,30 +287,22 @@
    1.13  		if(c->maxh && c->h > c->maxh)
    1.14  			c->h = c->maxh;
    1.15  	}
    1.16 -	if(c->x > sw) /* might happen on restart */
    1.17 -		c->x = sw - c->w;
    1.18 -	if(c->y > sh)
    1.19 -		c->y = sh - c->h;
    1.20  	if(sticky == TopRight || sticky == BotRight)
    1.21  		c->x = right - c->w;
    1.22  	if(sticky == BotLeft || sticky == BotRight)
    1.23  		c->y = bottom - c->h;
    1.24  
    1.25  	resizetitle(c);
    1.26 -	XSetWindowBorderWidth(dpy, c->win, 1);
    1.27 -	XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
    1.28  
    1.29 -	e.type = ConfigureNotify;
    1.30 -	e.event = c->win;
    1.31 -	e.window = c->win;
    1.32 -	e.x = c->x;
    1.33 -	e.y = c->y;
    1.34 -	e.width = c->w;
    1.35 -	e.height = c->h;
    1.36 -	e.border_width = c->border;
    1.37 -	e.above = None;
    1.38 -	e.override_redirect = False;
    1.39 -	XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e);
    1.40 +	if(c->tags[tsel])
    1.41 +		wc.x = c->x;
    1.42 +	else
    1.43 +		wc.x = c->x + 2 * sw;
    1.44 +	wc.y = c->y;
    1.45 +	wc.width = c->w;
    1.46 +	wc.height = c->h;
    1.47 +	wc.border_width = 1;
    1.48 +	XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
    1.49  	XSync(dpy, False);
    1.50  }
    1.51