dwm

dynamic window manager

git clone https://9o.is/git/dwm.git

commit ed424e1e466738606ce2c148104b3cf7a4551c19
parent a8f1cea537b87ff32e93b311ace0d2ff6f3fba10
Author: Jul <jul@9o.is>
Date:   Mon, 16 Feb 2026 08:08:17 +0800

warp cursor in missing actions

Diffstat:
Mdwm.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/dwm.c b/dwm.c @@ -1083,6 +1083,7 @@ focusstack(const Arg *arg) selmon->fg = c; arrange(selmon); focus(c); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); } else if (c) { focus(c); @@ -1239,6 +1240,7 @@ incnmaster(const Arg *arg) { selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); arrange(selmon); + XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2); } #ifdef XINERAMA @@ -1479,6 +1481,7 @@ pop(Client *c) attach(c); focus(c); arrange(c->mon); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); } void @@ -1810,6 +1813,7 @@ setmfact(const Arg *arg) return; selmon->mfact = f; arrange(selmon); + XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2); } void @@ -1982,6 +1986,7 @@ tag(const Arg *arg) setclienttagprop(selmon->sel); focus(NULL); arrange(selmon); + XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2); } } @@ -2066,6 +2071,7 @@ toggletag(const Arg *arg) setclienttagprop(selmon->sel); focus(NULL); arrange(selmon); + XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2); } } @@ -2078,6 +2084,7 @@ toggleview(const Arg *arg) selmon->tagset[selmon->seltags] = newtagset; focus(NULL); arrange(selmon); + XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2); } } @@ -2435,6 +2442,7 @@ view(const Arg *arg) selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; focus(NULL); arrange(selmon); + XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2); } pid_t