about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client.c25
-rw-r--r--event.c51
2 files changed, 29 insertions, 47 deletions
diff --git a/client.c b/client.c
index e37b9e6..b9c519b 100644
--- a/client.c
+++ b/client.c
@@ -69,19 +69,20 @@ xerrordummy(Display *dsply, XErrorEvent *ee) {
 
 void
 configure(Client *c) {
-	XEvent synev;
+	XConfigureEvent ce;
 
-	synev.type = ConfigureNotify;
-	synev.xconfigure.display = dpy;
-	synev.xconfigure.event = c->win;
-	synev.xconfigure.window = c->win;
-	synev.xconfigure.x = c->x;
-	synev.xconfigure.y = c->y;
-	synev.xconfigure.width = c->w;
-	synev.xconfigure.height = c->h;
-	synev.xconfigure.border_width = c->border;
-	synev.xconfigure.above = None;
-	XSendEvent(dpy, c->win, True, NoEventMask, &synev);
+	ce.type = ConfigureNotify;
+	ce.display = dpy;
+	ce.event = c->win;
+	ce.window = c->win;
+	ce.x = c->x;
+	ce.y = c->y;
+	ce.width = c->w;
+	ce.height = c->h;
+	ce.border_width = c->border;
+	ce.above = None;
+	ce.override_redirect = False;
+	XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
 }
 
 void
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
84' href='#n284'>284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397