diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-13 13:39:33 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-13 13:39:33 +0100 |
| commit | 71857b87ee4e5ce63594d062143e6ea78f842b0d (patch) | |
| tree | 0227631c0e98178d885ebb1e539dd2437246e5a1 | |
| parent | yet another consistency fix of dwm (diff) | |
| download | dwm-71857b87ee4e5ce63594d062143e6ea78f842b0d.tar.gz dwm-71857b87ee4e5ce63594d062143e6ea78f842b0d.zip | |
simplified configurerequest
| -rw-r--r-- | client.c | 25 | ||||
| -rw-r--r-- | event.c | 51 |
2 files changed, 29 insertions, 47 deletions
| @@ -69,19 +69,20 @@ xerrordummy(Display *dsply, XErrorEvent *ee) { | |||
| 69 | 69 | ||
| 70 | void | 70 | void |
| 71 | configure(Client *c) { | 71 | configure(Client *c) { |
| 72 | XEvent synev; | 72 | XConfigureEvent ce; |
| 73 | 73 | ||
| 74 | synev.type = ConfigureNotify; | 74 | ce.type = ConfigureNotify; |
| 75 | synev.xconfigure.display = dpy; | 75 | ce.display = dpy; |
| 76 | synev.xconfigure.event = c->win; | 76 | ce.event = c->win; |
| 77 | synev.xconfigure.window = c->win; | 77 | ce.window = c->win; |
| 78 | synev.xconfigure.x = c->x; | 78 | ce.x = c->x; |
| 79 | synev.xconfigure.y = c->y; | 79 | ce.y = c->y; |
| 80 | synev.xconfigure.width = c->w; | 80 | ce.width = c->w; |
| 81 | synev.xconfigure.height = c->h; | 81 | ce.height = c->h; |
| 82 | synev.xconfigure.border_width = c->border; | 82 | ce.border_width = c->border; |
| 83 | synev.xconfigure.above = None; | 83 | ce.above = None; |
| 84 | XSendEvent(dpy, c->win, True, NoEventMask, &synev); | 84 | ce.override_redirect = False; |
| 85 | XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); | ||
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | void | 88 | void |
| @@ -166,52 +166,33 @@ buttonpress(XEvent *e) { | |||
| 166 | 166 | ||
| 167 | static void | 167 | static void |
| 168 | configurerequest(XEvent *e) { | 168 | configurerequest(XEvent *e) { |
| 169 | unsigned long newmask; | ||
| 170 | Client *c; | 169 | Client *c; |
| 171 | XConfigureRequestEvent *ev = &e->xconfigurerequest; | 170 | XConfigureRequestEvent *ev = &e->xconfigurerequest; |
| 172 | XWindowChanges wc; | 171 | XWindowChanges wc; |
| 173 | 172 | ||
| 173 | wc.x = ev->x; | ||
| 174 | wc.y = ev->y; | ||
| 175 | wc.width = ev->width; | ||
| 176 | wc.height = ev->height; | ||
| 177 | wc.border_width = ev->border_width; | ||
| 178 | wc.sibling = ev->above; | ||
| 179 | wc.stack_mode = ev->detail; | ||
| 174 | if((c = getclient(ev->window))) { | 180 | if((c = getclient(ev->window))) { |
| 175 | c->ismax = False; | 181 | c->ismax = False; |
| 176 | if(ev->value_mask & CWX) | ||
| 177 | c->x = ev->x; | ||
| 178 | if(ev->value_mask & CWY) | ||
| 179 | c->y = ev->y; | ||
| 180 | if(ev->value_mask & CWWidth) | ||
| 181 | c->w = ev->width; | ||
| 182 | if(ev->value_mask & CWHeight) | ||
| 183 | c->h = ev->height; | ||
| 184 | if(ev->value_mask & CWBorderWidth) | 182 | if(ev->value_mask & CWBorderWidth) |
| 185 | c->border = ev->border_width; | 183 | c->border = ev->border_width; |
| 186 | wc.x = c->x; | 184 | if((!c->isfloat && (arrange != dofloat)) |
| 187 | wc.y = c->y; | 185 | || ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight)))) |
| 188 | wc.width = c->w; | 186 | { |
| 189 | wc.height = c->h; | ||
| 190 | newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth)); | ||
| 191 | if(newmask) | ||
| 192 | XConfigureWindow(dpy, c->win, newmask, &wc); | ||
| 193 | else | ||
| 194 | configure(c); | 187 | configure(c); |
| 195 | XSync(dpy, False); | 188 | XSync(dpy, False); |
| 196 | if(c->isfloat) { | 189 | return; |
| 197 | resize(c, False); | ||
| 198 | if(!isvisible(c)) | ||
| 199 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 200 | } | 190 | } |
| 201 | else | ||
| 202 | arrange(); | ||
| 203 | } | ||
| 204 | else { | ||
| 205 | wc.x = ev->x; | ||
| 206 | wc.y = ev->y; | ||
| 207 | wc.width = ev->width; | ||
| 208 | wc.height = ev->height; | ||
| 209 | wc.border_width = ev->border_width; | ||
| 210 | wc.sibling = ev->above; | ||
| 211 | wc.stack_mode = ev->detail; | ||
| 212 | XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); | ||
| 213 | XSync(dpy, False); | ||
| 214 | } | 191 | } |
| 192 | XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); | ||
| 193 | if(c && !isvisible(c)) | ||
| 194 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 195 | XSync(dpy, False); | ||
| 215 | } | 196 | } |
| 216 | 197 | ||
| 217 | static void | 198 | static void |
