diff options
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/include.c | 4 | ||||
| -rw-r--r-- | patch/include.h | 4 | ||||
| -rw-r--r-- | patch/tagall.c | 25 | ||||
| -rw-r--r-- | patch/tagall.h | 1 |
4 files changed, 34 insertions, 0 deletions
diff --git a/patch/include.c b/patch/include.c index fa6905c..714e4b4 100644 --- a/patch/include.c +++ b/patch/include.c @@ -98,6 +98,10 @@ #include "switchcol.c" #endif +#if TAGALL_PATCH +#include "tagall.c" +#endif + #if TAGALLMON_PATCH #include "tagallmon.c" #endif diff --git a/patch/include.h b/patch/include.h index f78287d..1cae911 100644 --- a/patch/include.h +++ b/patch/include.h @@ -98,6 +98,10 @@ #include "switchcol.h" #endif +#if TAGALL_PATCH +#include "tagall.h" +#endif + #if TAGALLMON_PATCH #include "tagallmon.h" #endif diff --git a/patch/tagall.c b/patch/tagall.c new file mode 100644 index 0000000..e978aaf --- /dev/null +++ b/patch/tagall.c @@ -0,0 +1,25 @@ +void +tagall(const Arg *arg) +{ + if (!selmon->clients) + return; + /* if parameter starts with F, just move floating windows */ + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; + int j; + Client* c; + if (tag >= 0 && tag < LENGTH(tags)) + for (c = selmon->clients; c; c = c->next) + { + if (!floating_only || c->isfloating) + for (j = 0; j < LENGTH(tags); j++) + { + if (c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) + { + c->tags = c->tags ^ (1 << j & TAGMASK); + c->tags = c->tags | 1 << (tag-1); + } + } + } + arrange(selmon); +}
\ No newline at end of file diff --git a/patch/tagall.h b/patch/tagall.h new file mode 100644 index 0000000..09fe4d1 --- /dev/null +++ b/patch/tagall.h @@ -0,0 +1 @@ +static void tagall(const Arg *arg);
\ No newline at end of file |
