aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index f33edd9..21f770d 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1249,6 +1249,8 @@ focusmon(const Arg *arg)
unfocus(selmon->sel, 0);
selmon = m;
focus(NULL);
+ if (selmon->sel)
+ XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2);
}
void
@@ -1264,6 +1266,7 @@ focusstack(const Arg *arg)
i -= ISVISIBLE(c) ? 1 : 0, p = c, c = c->next);
focus(c ? c : p);
restack(selmon);
+ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2);
}
Atom
@@ -1614,6 +1617,8 @@ manage(Window w, XWindowAttributes *wa)
swallow(term, c);
arrange(c->mon);
focus(NULL);
+ if (c && c->mon == selmon)
+ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2);
}
void
@@ -2655,6 +2660,9 @@ unmanage(Client *c, int destroyed)
arrange(m);
focus(NULL);
updateclientlist();
+ if (m == selmon && m->sel)
+ XWarpPointer(dpy, None, m->sel->win, 0, 0, 0, 0,
+ m->sel->w/2, m->sel->h/2);
}
}