aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h5
-rw-r--r--dwm.c14
2 files changed, 15 insertions, 4 deletions
diff --git a/config.h b/config.h
index 3140b32..8f56c2d 100644
--- a/config.h
+++ b/config.h
@@ -10,8 +10,9 @@
/* appearance */
/* followclient:
- * 1: if sending a client to a new tag with no other clients, the view will
- * follow the client
+ * 1:
+ * - the view will follow the client when sent to an empty tag
+ * - the focus and cursor will follow the client when sent to a new monitor
* 0: default behaviour */
static const int followclient = 1;
static unsigned int borderpx = 2; /* border pixel of windows */
diff --git a/dwm.c b/dwm.c
index b73473b..6ae6288 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2122,8 +2122,18 @@ sendmon(Client *c, Monitor *m)
attachaside(c);
attachstack(c);
setclienttagprop(c);
- focus(NULL);
- arrange(NULL);
+
+ if (followclient) {
+ focus(c);
+ arrange(NULL);
+
+ if (c && c->mon == selmon) {
+ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
+ }
+ } else {
+ focus(NULL);
+ arrange(NULL);
+ }
}
void