fixed configurerequest according to the problem Jukka reported
31673735
1 file(s) · +16 −11
| 165 | 165 | ||
| 166 | 166 | static void |
|
| 167 | 167 | configurerequest(XEvent *e) { |
|
| 168 | + | int x, y, w, h; |
|
| 168 | 169 | Client *c; |
|
| 169 | 170 | XConfigureRequestEvent *ev = &e->xconfigurerequest; |
|
| 170 | 171 | XWindowChanges wc; |
|
| 174 | 175 | if(ev->value_mask & CWBorderWidth) |
|
| 175 | 176 | c->border = ev->border_width; |
|
| 176 | 177 | if(c->isfixed || c->isfloat || (arrange == dofloat)) { |
|
| 177 | - | if(ev->value_mask & CWX) |
|
| 178 | - | c->x = ev->x; |
|
| 179 | - | if(ev->value_mask & CWY) |
|
| 180 | - | c->y = ev->y; |
|
| 181 | - | if(ev->value_mask & CWWidth) |
|
| 182 | - | c->w = ev->width; |
|
| 183 | - | if(ev->value_mask & CWHeight) |
|
| 184 | - | c->h = ev->height; |
|
| 178 | + | x = (ev->value_mask & CWX) ? ev->x : c->x; |
|
| 179 | + | y = (ev->value_mask & CWY) ? ev->y : c->y; |
|
| 180 | + | w = (ev->value_mask & CWWidth) ? ev->width : c->w; |
|
| 181 | + | h = (ev->value_mask & CWHeight) ? ev->height : c->h; |
|
| 185 | 182 | if((ev->value_mask & (CWX | CWY)) |
|
| 186 | 183 | && !(ev->value_mask & (CWWidth | CWHeight))) |
|
| 184 | + | { |
|
| 185 | + | c->x = x; |
|
| 186 | + | c->y = y; |
|
| 187 | 187 | configure(c); |
|
| 188 | - | resize(c, c->x, c->y, c->w, c->h, False); |
|
| 189 | - | if(!isvisible(c)) |
|
| 190 | - | ban(c); |
|
| 188 | + | if(isvisible(c)) |
|
| 189 | + | XMoveWindow(dpy, c->win, c->x, c->y); |
|
| 190 | + | } |
|
| 191 | + | else { |
|
| 192 | + | resize(c, x, y, w, h, False); |
|
| 193 | + | if(!isvisible(c)) |
|
| 194 | + | ban(c); |
|
| 195 | + | } |
|
| 191 | 196 | } |
|
| 192 | 197 | else |
|
| 193 | 198 | configure(c); |
|