[hackers] [dwm] stupid me, one needs to set c->{x,y,w,h} in configurerequest obviously ; )

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Tue Feb 13 15:01:42 2007

changeset: 753:db484aa5c2cf
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Tue Feb 13 14:59:58 2007 +0100
summary: stupid me, one needs to set c->{x,y,w,h} in configurerequest obviously ;)

diff -r 9fe042b02e18 -r db484aa5c2cf event.c
--- a/event.c Tue Feb 13 13:39:33 2007 +0100
+++ b/event.c Tue Feb 13 14:59:58 2007 +0100
@@ -170,28 +170,32 @@ configurerequest(XEvent *e) {
         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 & CWBorderWidth)
- c->border = ev->border_width;
+ c->border = (ev->value_mask & CWBorderWidth) ? ev->border_width : c->border;
                 if((!c->isfloat && (arrange != dofloat))
- || ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))))
- {
+ || ((ev->value_mask & (CWX | CWY)) && !(ev->value_mask & (CWWidth | CWHeight))))
                         configure(c);
- XSync(dpy, False);
- return;
- }
- }
- XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
- if(c && !isvisible(c))
- XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+ else {
+ c->x = (ev->value_mask & CWX) ? ev->x : c->x;
+ c->y = (ev->value_mask & CWY) ? ev->y : c->y;
+ c->w = (ev->value_mask & CWWidth) ? ev->width : c->w;
+ c->h = (ev->value_mask & CWHeight) ? ev->height : c->h;
+ resize(c, False);
+ if(!isvisible(c))
+ XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+ }
+ }
+ 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);
 }
 
Received on Tue Feb 13 2007 - 15:01:42 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:16 UTC