added some TODOs, some other focus fixes
ab06f744
1 file(s) · +6 −2
| 1504 | 1504 | c->mon = m; |
|
| 1505 | 1505 | attach(c); |
|
| 1506 | 1506 | attachstack(c); |
|
| 1507 | - | selmon->sel = selmon->stack; |
|
| 1508 | 1507 | m->sel = c; |
|
| 1508 | + | for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); |
|
| 1509 | + | selmon->sel = c; |
|
| 1509 | 1510 | arrange(); |
|
| 1510 | 1511 | break; |
|
| 1511 | 1512 | } |
|
| 1620 | 1621 | detach(c); |
|
| 1621 | 1622 | detachstack(c); |
|
| 1622 | 1623 | if(c->mon->sel == c) { |
|
| 1623 | - | c->mon->sel = c->mon->stack; |
|
| 1624 | + | /* TODO: consider separate the next code into a function or into detachstack? */ |
|
| 1625 | + | Client *tc; |
|
| 1626 | + | for(tc = c->mon->stack; tc && !ISVISIBLE(tc); tc = tc->snext); |
|
| 1627 | + | c->mon->sel = tc; |
|
| 1624 | 1628 | focus(NULL); |
|
| 1625 | 1629 | } |
|
| 1626 | 1630 | XUngrabButton(dpy, AnyButton, AnyModifier, c->win); |
|