applied sanders patch of not manipulating sel
0925dd58
2 file(s) · +8 −6
| 414 | 414 | void |
|
| 415 | 415 | unmanage(Client *c) |
|
| 416 | 416 | { |
|
| 417 | + | Client *nc; |
|
| 418 | + | ||
| 417 | 419 | XGrabServer(dpy); |
|
| 418 | 420 | XSetErrorHandler(xerrordummy); |
|
| 419 | 421 | ||
| 420 | 422 | detach(c); |
|
| 421 | 423 | detachstack(c); |
|
| 422 | 424 | if(sel == c) { |
|
| 423 | - | for(sel = stack; sel && !isvisible(sel); sel = sel->snext); |
|
| 424 | - | focus(sel); |
|
| 425 | + | for(nc = stack; nc && !isvisible(nc); nc = nc->snext); |
|
| 426 | + | focus(nc); |
|
| 425 | 427 | } |
|
| 426 | 428 | ||
| 427 | 429 | XUngrabButton(dpy, AnyButton, AnyModifier, c->win); |
| 77 | 77 | ban(c); |
|
| 78 | 78 | } |
|
| 79 | 79 | if(!sel || !isvisible(sel)) { |
|
| 80 | - | for(sel = stack; sel && !isvisible(sel); sel = sel->snext); |
|
| 81 | - | focus(sel); |
|
| 80 | + | for(c = stack; c && !isvisible(c); c = c->snext); |
|
| 81 | + | focus(c); |
|
| 82 | 82 | } |
|
| 83 | 83 | restack(); |
|
| 84 | 84 | } |
|
| 141 | 141 | ban(c); |
|
| 142 | 142 | } |
|
| 143 | 143 | if(!sel || !isvisible(sel)) { |
|
| 144 | - | for(sel = stack; sel && !isvisible(sel); sel = sel->snext); |
|
| 145 | - | focus(sel); |
|
| 144 | + | for(c = stack; c && !isvisible(c); c = c->snext); |
|
| 145 | + | focus(c); |
|
| 146 | 146 | } |
|
| 147 | 147 | restack(); |
|
| 148 | 148 | } |
|