diff options
author | davidpkj <davidpenkow1@gmail.com> | 2023-08-27 20:36:17 +0200 |
---|---|---|
committer | davidpkj <davidpenkow1@gmail.com> | 2023-08-27 20:36:17 +0200 |
commit | eebdffb5657591c6c8f697ba9b2996b74d96e6e0 (patch) | |
tree | 177ec85bffe2269075159fc3af3f0c86ae4e286e /dwm.c | |
parent | eb71fa427a8dc424417e860619ee06538b0016bb (diff) |
Custom changes to multihead functionality
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -2072,15 +2072,25 @@ 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 |