diff options
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 30 |
1 files changed, 19 insertions, 11 deletions
| @@ -271,7 +271,7 @@ resize(Client *c, Bool sizehints, Corner sticky) | |||
| 271 | { | 271 | { |
| 272 | int bottom = c->y + c->h; | 272 | int bottom = c->y + c->h; |
| 273 | int right = c->x + c->w; | 273 | int right = c->x + c->w; |
| 274 | XWindowChanges wc; | 274 | XConfigureEvent e; |
| 275 | 275 | ||
| 276 | if(sizehints) { | 276 | if(sizehints) { |
| 277 | if(c->incw) | 277 | if(c->incw) |
| @@ -287,22 +287,30 @@ resize(Client *c, Bool sizehints, Corner sticky) | |||
| 287 | if(c->maxh && c->h > c->maxh) | 287 | if(c->maxh && c->h > c->maxh) |
| 288 | c->h = c->maxh; | 288 | c->h = c->maxh; |
| 289 | } | 289 | } |
| 290 | if(c->x > sw) /* might happen on restart */ | ||
| 291 | c->x = sw - c->w; | ||
| 292 | if(c->y > sh) | ||
| 293 | c->y = sh - c->h; | ||
| 290 | if(sticky == TopRight || sticky == BotRight) | 294 | if(sticky == TopRight || sticky == BotRight) |
| 291 | c->x = right - c->w; | 295 | c->x = right - c->w; |
| 292 | if(sticky == BotLeft || sticky == BotRight) | 296 | if(sticky == BotLeft || sticky == BotRight) |
| 293 | c->y = bottom - c->h; | 297 | c->y = bottom - c->h; |
| 294 | 298 | ||
| 295 | resizetitle(c); | 299 | resizetitle(c); |
| 296 | 300 | XSetWindowBorderWidth(dpy, c->win, 1); | |
| 297 | if(c->tags[tsel]) | 301 | XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); |
| 298 | wc.x = c->x; | 302 | |
| 299 | else | 303 | e.type = ConfigureNotify; |
| 300 | wc.x = c->x + 2 * sw; | 304 | e.event = c->win; |
| 301 | wc.y = c->y; | 305 | e.window = c->win; |
| 302 | wc.width = c->w; | 306 | e.x = c->x; |
| 303 | wc.height = c->h; | 307 | e.y = c->y; |
| 304 | wc.border_width = 1; | 308 | e.width = c->w; |
| 305 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); | 309 | e.height = c->h; |
| 310 | e.border_width = c->border; | ||
| 311 | e.above = None; | ||
| 312 | e.override_redirect = False; | ||
| 313 | XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e); | ||
| 306 | XSync(dpy, False); | 314 | XSync(dpy, False); |
| 307 | } | 315 | } |
| 308 | 316 | ||
