From 84ab815e68ba89c914904a55378848e92ba00bd7 Mon Sep 17 00:00:00 2001 From: ProsperousPotato Date: Thu, 6 Feb 2025 13:29:24 +0000 Subject: warp cursor to center of screen when fullscreen --- dwm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dwm.c b/dwm.c index 8cbede4..080184e 100644 --- a/dwm.c +++ b/dwm.c @@ -959,7 +959,7 @@ focusmon(const Arg *arg) 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); + XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2); } void @@ -1886,6 +1886,7 @@ setfullscreen(Client *c, int fullscreen) c->isfloating = 1; resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); XRaiseWindow(dpy, c->win); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); } else if (!fullscreen && c->isfullscreen){ XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)0, 0); @@ -1898,6 +1899,7 @@ setfullscreen(Client *c, int fullscreen) c->h = c->oldh; resizeclient(c, c->x, c->y, c->w, c->h); arrange(c->mon); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); } } -- cgit v1.2.3