aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authordavidpkj <davidpenkow1@gmail.com>2023-08-27 20:36:17 +0200
committerdavidpkj <davidpenkow1@gmail.com>2023-08-27 20:36:17 +0200
commiteebdffb5657591c6c8f697ba9b2996b74d96e6e0 (patch)
tree177ec85bffe2269075159fc3af3f0c86ae4e286e /dwm.c
parenteb71fa427a8dc424417e860619ee06538b0016bb (diff)
Custom changes to multihead functionality
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index bce09fd..6470b69 100644
--- a/dwm.c
+++ b/dwm.c
@@ -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