aewl

diff event.c @ 386:58288246d16c

now dwm enforces max screen size also in tiled mode on non-floating clients which are maximized
author Anselm R. Garbe <arg@10kloc.org>
date Tue, 29 Aug 2006 18:05:02 +0200
parents 37706ba7d492
children dca6aca09653
line diff
     1.1 --- a/event.c	Tue Aug 29 17:33:27 2006 +0200
     1.2 +++ b/event.c	Tue Aug 29 18:05:02 2006 +0200
     1.3 @@ -150,7 +150,6 @@
     1.4  static void
     1.5  configurerequest(XEvent *e)
     1.6  {
     1.7 -	int ox, oy, ow, oh;
     1.8  	unsigned long newmask;
     1.9  	Client *c;
    1.10  	XConfigureRequestEvent *ev = &e->xconfigurerequest;
    1.11 @@ -158,10 +157,20 @@
    1.12  	XWindowChanges wc;
    1.13  
    1.14  	if((c = getclient(ev->window))) {
    1.15 -		ox = c->x;
    1.16 -		oy = c->y;
    1.17 -		ow = c->w;
    1.18 -		oh = c->h;
    1.19 +		if(!c->isfloat && (arrange != dofloat) && c->ismax) {
    1.20 +			synev.type = ConfigureNotify;
    1.21 +			synev.xconfigure.display = dpy;
    1.22 +			synev.xconfigure.event = c->win;
    1.23 +			synev.xconfigure.window = c->win;
    1.24 +			synev.xconfigure.x = sx;
    1.25 +			synev.xconfigure.y = sy + bh;
    1.26 +			synev.xconfigure.width = sw - 2;
    1.27 +			synev.xconfigure.height = sw - 2 - bh;
    1.28 +			synev.xconfigure.border_width = ev->border_width;
    1.29 +			synev.xconfigure.above = None;
    1.30 +			XSendEvent(dpy, c->win, True, NoEventMask, &synev);
    1.31 +			return;
    1.32 +		}
    1.33  		gravitate(c, True);
    1.34  		if(ev->value_mask & CWX)
    1.35  			c->x = ev->x;
    1.36 @@ -192,19 +201,11 @@
    1.37  			synev.xconfigure.height = c->h;
    1.38  			synev.xconfigure.border_width = c->border;
    1.39  			synev.xconfigure.above = None;
    1.40 -			/* Send synthetic ConfigureNotify */
    1.41  			XSendEvent(dpy, c->win, True, NoEventMask, &synev);
    1.42  		}
    1.43  		XSync(dpy, False);
    1.44  		if(c->isfloat)
    1.45  			resize(c, False, TopLeft);
    1.46 -		else if(c->ismax) {
    1.47 -			resize(c, False, TopLeft);
    1.48 -			c->x = ox;
    1.49 -			c->y = oy;
    1.50 -			c->w = ow;
    1.51 -			c->h = oh;
    1.52 -		}
    1.53  		else
    1.54  			arrange(NULL);
    1.55  	}