Adding switchcol patch

This commit is contained in:
bakkeby
2019-10-04 00:20:47 +02:00
parent 40000bba1c
commit 853c64fbb7
6 changed files with 47 additions and 2 deletions

View File

@ -86,6 +86,10 @@
#include "systray.c"
#endif
#if SWITCHCOL_PATCH
#include "switchcol.c"
#endif
#if TAGALLMON_PATCH
#include "tagallmon.c"
#endif

View File

@ -86,6 +86,10 @@
#include "systray.h"
#endif
#if SWITCHCOL_PATCH
#include "switchcol.h"
#endif
#if TAGALLMON_PATCH
#include "tagallmon.h"
#endif

28
patch/switchcol.c Normal file
View File

@ -0,0 +1,28 @@
void
switchcol(const Arg *arg)
{
Client *c, *t;
int col = 0;
int i;
if (!selmon->sel)
return;
for (i = 0, c = nexttiled(selmon->clients); c ;
c = nexttiled(c->next), i++) {
if (c == selmon->sel)
col = (i + 1) > selmon->nmaster;
}
if (i <= selmon->nmaster)
return;
for (c = selmon->stack; c; c = c->snext) {
if (!ISVISIBLE(c))
continue;
for (i = 0, t = nexttiled(selmon->clients); t && t != c;
t = nexttiled(t->next), i++);
if (t && (i + 1 > selmon->nmaster) != col) {
focus(c);
restack(selmon);
break;
}
}
}

1
patch/switchcol.h Normal file
View File

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