Adding transferall patch

This commit is contained in:
bakkeby
2020-02-02 11:55:19 +01:00
parent 4ddfdab30e
commit 6de03c1735
7 changed files with 45 additions and 1 deletions

View File

@ -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

View File

@ -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

25
patch/transferall.c Normal file
View File

@ -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);
}

1
patch/transferall.h Normal file
View File

@ -0,0 +1 @@
static void transferall(const Arg *arg);