about summary refs log tree commit diff stats
path: root/event.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-13 13:39:33 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-13 13:39:33 +0100
commit71857b87ee4e5ce63594d062143e6ea78f842b0d (patch)
tree0227631c0e98178d885ebb1e539dd2437246e5a1 /event.c
parent6ba400ee0fa55d1178cac5f38f4465a1ddf30490 (diff)
downloaddwm-71857b87ee4e5ce63594d062143e6ea78f842b0d.tar.gz
simplified configurerequest
Diffstat (limited to 'event.c')
-rw-r--r--event.c51
1 files changed, 16 insertions, 35 deletions
diff --git a/event.c b/event.c
index 4e4649b..4928f25 100644
--- a/event.c
+++ b/event.c
@@ -166,52 +166,33 @@ buttonpress(XEvent *e) {
 
 static void
 configurerequest(XEvent *e) {
-	unsigned long newmask;
 	Client *c;
 	XConfigureRequestEvent *ev = &e->xconfigurerequest;
 	XWindowChanges wc;
 
+	wc.x = ev->x;
+	wc.y = ev->y;
+	wc.width = ev->width;
+	wc.height = ev->height;
+	wc.border_width = ev->border_width;
+	wc.sibling = ev->above;
+	wc.stack_mode = ev->detail;
 	if((c = getclient(ev->window))) {
 		c->ismax = False;
-		if(ev->value_mask & CWX)
-			c->x = ev->x;
-		if(ev->value_mask & CWY)
-			c->y = ev->y;
-		if(ev->value_mask & CWWidth)
-			c->w = ev->width;
-		if(ev->value_mask & CWHeight)
-			c->h = ev->height;
 		if(ev->value_mask & CWBorderWidth)
 			c->border = ev->border_width;
-		wc.x = c->x;
-		wc.y = c->y;
-		wc.width = c->w;
-		wc.height = c->h;
-		newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
-		if(newmask)
-			XConfigureWindow(dpy, c->win, newmask, &wc);
-		else
+		if((!c->isfloat && (arrange != dofloat))
+			|| ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))))
+		{
 			configure(c);
-		XSync(dpy, False);
-		if(c->isfloat) {
-			resize(c, False);
-			if(!isvisible(c))
-				XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+			XSync(dpy, False);
+			return;
 		}
-		else
-			arrange();
-	}
-	else {
-		wc.x = ev->x;
-		wc.y = ev->y;
-		wc.width = ev->width;
-		wc.height = ev->height;
-		wc.border_width = ev->border_width;
-		wc.sibling = ev->above;
-		wc.stack_mode = ev->detail;
-		XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
-		XSync(dpy, False);
 	}
+	XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
+	if(c && !isvisible(c))
+		XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+	XSync(dpy, False);
 }
 
 static void
/a> 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296