aewl

diff event.c @ 115:329fd7dae530

removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
author arg@10ksloc.org
date Thu, 20 Jul 2006 07:26:23 +0200
parents dfa5cd0969a6
children eb3165734f00
line diff
     1.1 --- a/event.c	Wed Jul 19 17:42:08 2006 +0200
     1.2 +++ b/event.c	Thu Jul 20 07:26:23 2006 +0200
     1.3 @@ -70,8 +70,8 @@
     1.4  	unsigned int dui;
     1.5  	Window dummy;
     1.6  
     1.7 -	ocx = *c->x;
     1.8 -	ocy = *c->y;
     1.9 +	ocx = c->x;
    1.10 +	ocy = c->y;
    1.11  	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
    1.12  				None, cursor[CurMove], CurrentTime) != GrabSuccess)
    1.13  		return;
    1.14 @@ -85,8 +85,8 @@
    1.15  			break;
    1.16  		case MotionNotify:
    1.17  			XSync(dpy, False);
    1.18 -			*c->x = ocx + (ev.xmotion.x - x1);
    1.19 -			*c->y = ocy + (ev.xmotion.y - y1);
    1.20 +			c->x = ocx + (ev.xmotion.x - x1);
    1.21 +			c->y = ocy + (ev.xmotion.y - y1);
    1.22  			resize(c, False, TopLeft);
    1.23  			break;
    1.24  		case ButtonRelease:
    1.25 @@ -103,12 +103,12 @@
    1.26  	int ocx, ocy;
    1.27  	Corner sticky;
    1.28  
    1.29 -	ocx = *c->x;
    1.30 -	ocy = *c->y;
    1.31 +	ocx = c->x;
    1.32 +	ocy = c->y;
    1.33  	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
    1.34  				None, cursor[CurResize], CurrentTime) != GrabSuccess)
    1.35  		return;
    1.36 -	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, *c->w, *c->h);
    1.37 +	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h);
    1.38  	for(;;) {
    1.39  		XMaskEvent(dpy, MouseMask | ExposureMask, &ev);
    1.40  		switch(ev.type) {
    1.41 @@ -118,10 +118,10 @@
    1.42  			break;
    1.43  		case MotionNotify:
    1.44  			XSync(dpy, False);
    1.45 -			*c->w = abs(ocx - ev.xmotion.x);
    1.46 -			*c->h = abs(ocy - ev.xmotion.y);
    1.47 -			*c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w;
    1.48 -			*c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h;
    1.49 +			c->w = abs(ocx - ev.xmotion.x);
    1.50 +			c->h = abs(ocy - ev.xmotion.y);
    1.51 +			c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
    1.52 +			c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h;
    1.53  			if(ocx <= ev.xmotion.x)
    1.54  				sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft;
    1.55  			else
    1.56 @@ -203,13 +203,13 @@
    1.57  	if((c = getclient(ev->window))) {
    1.58  		gravitate(c, True);
    1.59  		if(ev->value_mask & CWX)
    1.60 -			*c->x = ev->x;
    1.61 +			c->x = ev->x;
    1.62  		if(ev->value_mask & CWY)
    1.63 -			*c->y = ev->y;
    1.64 +			c->y = ev->y;
    1.65  		if(ev->value_mask & CWWidth)
    1.66 -			*c->w = ev->width;
    1.67 +			c->w = ev->width;
    1.68  		if(ev->value_mask & CWHeight)
    1.69 -			*c->h = ev->height;
    1.70 +			c->h = ev->height;
    1.71  		if(ev->value_mask & CWBorderWidth)
    1.72  			c->border = 1;
    1.73  		gravitate(c, False);