diff options
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 14 |
1 files changed, 10 insertions, 4 deletions
| @@ -185,9 +185,11 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 185 | c->y = wa->y; | 185 | c->y = wa->y; |
| 186 | c->w = wa->width; | 186 | c->w = wa->width; |
| 187 | c->h = wa->height; | 187 | c->h = wa->height; |
| 188 | c->oldborder = wa->border_width; | ||
| 188 | if(c->w == sw && c->h == sh) { | 189 | if(c->w == sw && c->h == sh) { |
| 189 | c->x = sx; | 190 | c->x = sx; |
| 190 | c->y = sy; | 191 | c->y = sy; |
| 192 | c->border = wa->border_width; | ||
| 191 | } | 193 | } |
| 192 | else { | 194 | else { |
| 193 | if(c->x + c->w + 2 * c->border > wax + waw) | 195 | if(c->x + c->w + 2 * c->border > wax + waw) |
| @@ -198,15 +200,16 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 198 | c->x = wax; | 200 | c->x = wax; |
| 199 | if(c->y < way) | 201 | if(c->y < way) |
| 200 | c->y = way; | 202 | c->y = way; |
| 203 | c->border = BORDERPX; | ||
| 201 | } | 204 | } |
| 205 | wc.border_width = c->border; | ||
| 206 | XConfigureWindow(dpy, w, CWBorderWidth, &wc); | ||
| 207 | XSetWindowBorder(dpy, w, dc.norm[ColBorder]); | ||
| 208 | configure(c); /* propagates border_width, if size doesn't change */ | ||
| 202 | updatesizehints(c); | 209 | updatesizehints(c); |
| 203 | XSelectInput(dpy, w, | 210 | XSelectInput(dpy, w, |
| 204 | StructureNotifyMask | PropertyChangeMask | EnterWindowMask); | 211 | StructureNotifyMask | PropertyChangeMask | EnterWindowMask); |
| 205 | grabbuttons(c, False); | 212 | grabbuttons(c, False); |
| 206 | c->border = wc.border_width = (c->w == sw && c->h == sh) ? wa->border_width : BORDERPX; | ||
| 207 | XConfigureWindow(dpy, w, CWBorderWidth, &wc); | ||
| 208 | XSetWindowBorder(dpy, w, dc.norm[ColBorder]); | ||
| 209 | configure(c); /* propagates border_width, if size doesn't change */ | ||
| 210 | updatetitle(c); | 213 | updatetitle(c); |
| 211 | if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success)) | 214 | if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success)) |
| 212 | for(t = clients; t && t->win != trans; t = t->next); | 215 | for(t = clients; t && t->win != trans; t = t->next); |
| @@ -378,10 +381,13 @@ updatetitle(Client *c) { | |||
| 378 | void | 381 | void |
| 379 | unmanage(Client *c) { | 382 | unmanage(Client *c) { |
| 380 | Client *nc; | 383 | Client *nc; |
| 384 | XWindowChanges wc; | ||
| 381 | 385 | ||
| 386 | wc.border_width = c->oldborder; | ||
| 382 | /* The server grab construct avoids race conditions. */ | 387 | /* The server grab construct avoids race conditions. */ |
| 383 | XGrabServer(dpy); | 388 | XGrabServer(dpy); |
| 384 | XSetErrorHandler(xerrordummy); | 389 | XSetErrorHandler(xerrordummy); |
| 390 | XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ | ||
| 385 | detach(c); | 391 | detach(c); |
| 386 | detachstack(c); | 392 | detachstack(c); |
| 387 | if(sel == c) { | 393 | if(sel == c) { |
