summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index e3afc9a..b54ccd4 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1504,8 +1504,9 @@ tagmon(const Arg *arg) {
1504 c->mon = m; 1504 c->mon = m;
1505 attach(c); 1505 attach(c);
1506 attachstack(c); 1506 attachstack(c);
1507 selmon->sel = selmon->stack;
1508 m->sel = c; 1507 m->sel = c;
1508 for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
1509 selmon->sel = c;
1509 arrange(); 1510 arrange();
1510 break; 1511 break;
1511 } 1512 }
@@ -1620,7 +1621,10 @@ unmanage(Client *c) {
1620 detach(c); 1621 detach(c);
1621 detachstack(c); 1622 detachstack(c);
1622 if(c->mon->sel == c) { 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 focus(NULL); 1628 focus(NULL);
1625 } 1629 }
1626 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 1630 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);