dwm
dynamic window manager
git clone https://9o.is/git/dwm.git
commit f377abd9a334289a95c26b1cbfb2fb6fdb3fe360 parent 4caaadf342e067a73f4909038a98aaff19bd0815 Author: Jul <jul@9o.is> Date: Sun, 1 Feb 2026 16:31:03 -0500 warp cursor on changing window, monitor, etc. Diffstat:
| M | dwm.c | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/dwm.c b/dwm.c @@ -903,6 +903,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); } */ @@ -929,6 +931,7 @@ focusstack(const Arg *arg) if (c) { focus(c); restack(selmon); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); } } @@ -1159,6 +1162,8 @@ manage(Window w, XWindowAttributes *wa) c->mon->sel = c; arrange(c->mon); XMapWindow(dpy, c->win); + if (c && c->mon == selmon) + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); focus(NULL); } @@ -1921,6 +1926,10 @@ unmanage(Client *c, int destroyed) focus(NULL); updateclientlist(); arrange(m); + if (m == selmon && m->sel) + XWarpPointer(dpy, None, m->sel->win, 0, 0, 0, 0, + m->sel->w/2, m->sel->h/2); + } void