]> git.armaanb.net Git - dwm.git/commitdiff
Apply cursorwarp patch
authorArmaan Bhojwani <me@armaanb.net>
Wed, 23 Jun 2021 16:52:59 +0000 (12:52 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Wed, 23 Jun 2021 17:55:10 +0000 (13:55 -0400)
dwm.c

diff --git a/dwm.c b/dwm.c
index 166e19c4ae3a890dc09330ebff580da7ee280d9e..c15a0c439d048ba43076ebbe4b7cde56b71b72e4 100644 (file)
--- 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);
 }
 
 void
@@ -928,6 +930,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);
        }
 }