diff options
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/include.c | 3 | ||||
| -rw-r--r-- | patch/include.h | 3 | ||||
| -rw-r--r-- | patch/transferall.c | 25 | ||||
| -rw-r--r-- | patch/transferall.h | 1 |
4 files changed, 32 insertions, 0 deletions
diff --git a/patch/include.c b/patch/include.c index 0b3c0d5..78177b3 100644 --- a/patch/include.c +++ b/patch/include.c @@ -131,6 +131,9 @@ #if TRANSFER_PATCH #include "transfer.c" #endif +#if TRANSFER_ALL_PATCH +#include "transferall.c" +#endif #if UNFLOATVISIBLE_PATCH #include "unfloatvisible.c" #endif diff --git a/patch/include.h b/patch/include.h index 96f9a4b..d728729 100644 --- a/patch/include.h +++ b/patch/include.h @@ -131,6 +131,9 @@ #if TRANSFER_PATCH #include "transfer.h" #endif +#if TRANSFER_ALL_PATCH +#include "transferall.h" +#endif #if UNFLOATVISIBLE_PATCH #include "unfloatvisible.h" #endif diff --git a/patch/transferall.c b/patch/transferall.c new file mode 100644 index 0000000..fe12699 --- /dev/null +++ b/patch/transferall.c @@ -0,0 +1,25 @@ +void +transferall(const Arg *arg) +{ + Client *c, *n = selmon->clients, *attachfrom = NULL; + int i = 0, nstackclients = 0; + while (n) { + c = n; + n = c->next; + if (!ISVISIBLE(c) || c->isfloating) continue; + if (i >= selmon->nmaster) { + detach(c); + if (!attachfrom) { + attach(c); + } else { + c->next = attachfrom->next; + attachfrom->next = c; + } + attachfrom = c; + nstackclients++; + } + i++; + } + selmon->nmaster = nstackclients; + arrange(selmon); +}
\ No newline at end of file diff --git a/patch/transferall.h b/patch/transferall.h new file mode 100644 index 0000000..5556468 --- /dev/null +++ b/patch/transferall.h @@ -0,0 +1 @@ +static void transferall(const Arg *arg);
\ No newline at end of file |
