diff options
| -rw-r--r-- | config.h | 2 | ||||
| -rw-r--r-- | dwm.c | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -12,7 +12,7 @@ static unsigned int borderpx = 2; /* border pixel of windows */ static unsigned int snap = 32; /* snap pixel */ static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ -static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */ +static const unsigned int systrayonleft = 1; /* 0: systray in the right corner, >0: systray on left of status text */ static const unsigned int systrayspacing = 2; /* systray spacing */ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ static const int showsystray = 1; /* 0 means no systray */ @@ -1249,6 +1249,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 @@ -1264,6 +1266,7 @@ focusstack(const Arg *arg) i -= ISVISIBLE(c) ? 1 : 0, p = c, c = c->next); focus(c ? c : p); restack(selmon); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); } Atom @@ -1614,6 +1617,8 @@ manage(Window w, XWindowAttributes *wa) swallow(term, c); arrange(c->mon); focus(NULL); + if (c && c->mon == selmon) + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); } void @@ -2655,6 +2660,9 @@ unmanage(Client *c, int destroyed) arrange(m); focus(NULL); updateclientlist(); + if (m == selmon && m->sel) + XWarpPointer(dpy, None, m->sel->win, 0, 0, 0, 0, + m->sel->w/2, m->sel->h/2); } } |