diff options
| -rw-r--r-- | config.h | 5 | ||||
| -rw-r--r-- | dwm.c | 12 |
2 files changed, 17 insertions, 0 deletions
@@ -9,6 +9,11 @@ #define WMNAME "sei" /* appearance */ +/* followclient: + * 1: if sending a client to a new tag with no other clients, the view will + * follow the client + * 0: default behaviour */ +static const int followclient = 1; 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 */ @@ -440,6 +440,8 @@ keyrelease(XEvent *e) { void combotag(const Arg *arg) { + Client *target = selmon->sel; + if(selmon->sel && arg->ui & TAGMASK) { if (combo) { selmon->sel->tags |= arg->ui & TAGMASK; @@ -449,6 +451,16 @@ combotag(const Arg *arg) { } 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); + } } } |