aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-29 23:16:21 -0800
committerFuwn <[email protected]>2024-01-29 23:16:21 -0800
commitd5482bfe9bddcbfbe1d4d90f62aa22092d63fe78 (patch)
treec1b5fa23387903125137035cab7b2fb9ffa51346
parentfix(ninja): lower required ninja version (diff)
downloadseiwm-d5482bfe9bddcbfbe1d4d90f62aa22092d63fe78.tar.xz
seiwm-d5482bfe9bddcbfbe1d4d90f62aa22092d63fe78.zip
feat(sei.c): followclient follows on tagmon
-rw-r--r--README.md4
-rw-r--r--config.h5
-rw-r--r--sei.c13
3 files changed, 17 insertions, 5 deletions
diff --git a/README.md b/README.md
index 1a6e78c..3ea3fb3 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,9 @@ makepkg -si
default name or to overwrite it completely
- XSession desktop entry
- centretitle patch toggle
-- `followclient`: Optionally follow a client's view if the target tag is empty
+- `followclient`:
+ - 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
- `systraypinning` toggle fix: If `systraypinning` is enabled, the system tray will
only toggle its visibility if the mutation originates from the monitor it is
pinned on.
diff --git a/config.h b/config.h
index 8e0b5da..a9a0f11 100644
--- a/config.h
+++ b/config.h
@@ -10,8 +10,9 @@
/* appearance */
static char wmname[] = "sei";
/* 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/sei.c b/sei.c
index ebb2820..094b085 100644
--- a/sei.c
+++ b/sei.c
@@ -2116,8 +2116,17 @@ void sendmon(Client *c, Monitor *m) {
attachaside(c);
attachstack(c);
setclienttagprop(c);
- focus(NULL);
- arrange(NULL);
+
+ if (followclient) {
+ focus(c);
+ arrange(c->mon);
+
+ 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 setclientstate(Client *c, long state) {