focusclient checks whether oldsel == sel

No need to do it outside the call.
This commit is contained in:
Devin J. Pohly 2020-08-02 18:46:34 -05:00
parent ef7a37649c
commit 59cd8dec94

9
dwl.c
View File

@ -718,11 +718,8 @@ void
focusmon(const Arg *arg) focusmon(const Arg *arg)
{ {
Client *sel = selclient(); Client *sel = selclient();
Monitor *m = dirtomon(arg->i);
if (m == selmon) selmon = dirtomon(arg->i);
return;
selmon = m;
focusclient(sel, focustop(selmon), 1); focusclient(sel, focustop(selmon), 1);
} }
@ -1437,9 +1434,7 @@ setmon(Client *c, Monitor *m, unsigned int newtags)
c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */ c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
arrange(m); arrange(m);
} }
/* Focus can change if c is the top of selmon before or after */ focusclient(oldsel, focustop(selmon), 1);
if (c == oldsel || c == selclient())
focusclient(oldsel, focustop(selmon), 1);
} }
void void