diff options
Diffstat (limited to '')
| -rw-r--r-- | client.c | 11 |
1 files changed, 3 insertions, 8 deletions
| @@ -416,20 +416,18 @@ togglemax(Arg *arg) | |||
| 416 | void | 416 | void |
| 417 | unmanage(Client *c) | 417 | unmanage(Client *c) |
| 418 | { | 418 | { |
| 419 | Client **l; | ||
| 420 | |||
| 421 | XGrabServer(dpy); | 419 | XGrabServer(dpy); |
| 422 | XSetErrorHandler(xerrordummy); | 420 | XSetErrorHandler(xerrordummy); |
| 423 | 421 | ||
| 424 | XUngrabButton(dpy, AnyButton, AnyModifier, c->win); | 422 | XUngrabButton(dpy, AnyButton, AnyModifier, c->win); |
| 425 | XDestroyWindow(dpy, c->title); | 423 | XDestroyWindow(dpy, c->title); |
| 426 | 424 | ||
| 427 | for(l = &clients; *l && *l != c; l = &(*l)->next); | ||
| 428 | if(c->prev) | 425 | if(c->prev) |
| 429 | c->prev->next = c->next; | 426 | c->prev->next = c->next; |
| 430 | if(c->next) | 427 | if(c->next) |
| 431 | c->next->prev = c->prev; | 428 | c->next->prev = c->prev; |
| 432 | *l = c->next; | 429 | if(c == clients) |
| 430 | clients = c->next; | ||
| 433 | if(sel == c) { | 431 | if(sel == c) { |
| 434 | sel = getnext(c->next); | 432 | sel = getnext(c->next); |
| 435 | if(!sel) | 433 | if(!sel) |
| @@ -450,7 +448,7 @@ unmanage(Client *c) | |||
| 450 | void | 448 | void |
| 451 | zoom(Arg *arg) | 449 | zoom(Arg *arg) |
| 452 | { | 450 | { |
| 453 | Client *c, **l; | 451 | Client *c; |
| 454 | 452 | ||
| 455 | if(!sel) | 453 | if(!sel) |
| 456 | return; | 454 | return; |
| @@ -461,13 +459,10 @@ zoom(Arg *arg) | |||
| 461 | } | 459 | } |
| 462 | 460 | ||
| 463 | /* pop */ | 461 | /* pop */ |
| 464 | for(l = &clients; *l && *l != sel; l = &(*l)->next); | ||
| 465 | if(sel->prev) | 462 | if(sel->prev) |
| 466 | sel->prev->next = sel->next; | 463 | sel->prev->next = sel->next; |
| 467 | if(sel->next) | 464 | if(sel->next) |
| 468 | sel->next->prev = sel->prev; | 465 | sel->next->prev = sel->prev; |
| 469 | *l = sel->next; | ||
| 470 | |||
| 471 | sel->prev = NULL; | 466 | sel->prev = NULL; |
| 472 | if(clients) | 467 | if(clients) |
| 473 | clients->prev = sel; | 468 | clients->prev = sel; |
