diff options
| author | ProsperousPotato <ProsperousPotato@users.noreply.github.com> | 2025-12-31 22:45:40 +0000 |
|---|---|---|
| committer | ProsperousPotato <ProsperousPotato@users.noreply.github.com> | 2025-12-31 22:45:40 +0000 |
| commit | f9bc705314a667085c12784d23ab8a4192d18c3f (patch) | |
| tree | 394a9d14e55c38cefcfb0d095b56c4672c267ec9 | |
| parent | 4aa7d94347b2dc940901d6e073a65df75ae04829 (diff) | |
focus follows sendmon
| -rw-r--r-- | dwm.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1646,15 +1646,21 @@ sendmon(Client *c, Monitor *m) { if (c->mon == m) return; + int hadfocus = (c == selmon->sel); unfocus(c, 1); detach(c); detachstack(c); + arrange(c->mon); c->mon = m; c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ attach(c); attachstack(c); - focus(NULL); - arrange(NULL); + arrange(m); + if (hadfocus) { + focus(c); + restack(m); + } else + focus(NULL); } void |
