From 7ca56085bf44b87a334a468386701163bec54f3e Mon Sep 17 00:00:00 2001 From: ProsperousPotato Date: Thu, 12 Sep 2024 12:05:07 +0100 Subject: Updated config --- dwm.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index f559af3..ca29a4b 100644 --- a/dwm.c +++ b/dwm.c @@ -941,6 +941,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 @@ -966,6 +968,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); } } @@ -1197,8 +1200,8 @@ manage(Window w, XWindowAttributes *wa) c->mon->sel = c; arrange(c->mon); XMapWindow(dpy, c->win); - if (term) - swallow(term, c); + if (c && c->mon == selmon) + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); focus(NULL); } @@ -1981,9 +1984,12 @@ unmanage(Client *c, int destroyed) free(c); if (!s) { - arrange(m); - focus(NULL); + 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); } } @@ -2192,7 +2198,7 @@ void updatestatus(void) { if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-"VERSION); + strcpy(stext, ""); drawbar(selmon); } -- cgit v1.2.3