diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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); } |
