aboutsummaryrefslogtreecommitdiff
path: root/sei.c
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-22 21:02:46 -0800
committerFuwn <[email protected]>2024-01-22 21:02:46 -0800
commitd49a6bc036a4bd410466d4d3fb69cd998fed0a2a (patch)
tree223b754e063ab4ea0ba5d75aa93bfe699ef0bdda /sei.c
parentstyle(vanitygaps.c): add explicit types to pad (diff)
downloadseiwm-d49a6bc036a4bd410466d4d3fb69cd998fed0a2a.tar.xz
seiwm-d49a6bc036a4bd410466d4d3fb69cd998fed0a2a.zip
feat(sei.c): followclient
Diffstat (limited to 'sei.c')
-rw-r--r--sei.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sei.c b/sei.c
index 6dacffa..c73a3d9 100644
--- a/sei.c
+++ b/sei.c
@@ -470,14 +470,29 @@ void keyrelease(XEvent *e) { combo = 0; }
void combotag(const Arg *arg) {
if (selmon->sel && arg->ui & TAGMASK) {
+ Client *target = selmon->sel;
+
if (combo) {
selmon->sel->tags |= arg->ui & TAGMASK;
} else {
combo = 1;
selmon->sel->tags = arg->ui & TAGMASK;
}
+
focus(NULL);
arrange(selmon);
+
+ if (followclient) {
+ Client *c;
+ int i = 0;
+
+ for (c = target->mon->clients; c && !ISVISIBLE(c); c = c->next)
+ if (c->tags == target->tags)
+ i += 1;
+
+ if (i <= 1)
+ view(arg);
+ }
}
}