Adding rotatestack patch
This commit is contained in:
@ -18,6 +18,10 @@
|
||||
#include "pertag.c"
|
||||
#endif
|
||||
|
||||
#if ROTATESTACK_PATCH
|
||||
#include "rotatestack.c"
|
||||
#endif
|
||||
|
||||
#if SYSTRAY_PATCH
|
||||
#include "systray.c"
|
||||
#endif
|
||||
|
@ -12,7 +12,11 @@
|
||||
|
||||
#if CYCLELAYOUTS_PATCH
|
||||
#include "cyclelayouts.h"
|
||||
#endif // CYCLELAYOUTS_PATCH
|
||||
#endif
|
||||
|
||||
#if ROTATESTACK_PATCH
|
||||
#include "rotatestack.h"
|
||||
#endif
|
||||
|
||||
#if SYSTRAY_PATCH
|
||||
#include "systray.h"
|
||||
|
52
patch/rotatestack.c
Normal file
52
patch/rotatestack.c
Normal file
@ -0,0 +1,52 @@
|
||||
void
|
||||
enqueue(Client *c)
|
||||
{
|
||||
Client *l;
|
||||
for (l = c->mon->clients; l && l->next; l = l->next);
|
||||
if (l) {
|
||||
l->next = c;
|
||||
c->next = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
enqueuestack(Client *c)
|
||||
{
|
||||
Client *l;
|
||||
for (l = c->mon->stack; l && l->snext; l = l->snext);
|
||||
if (l) {
|
||||
l->snext = c;
|
||||
c->snext = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rotatestack(const Arg *arg)
|
||||
{
|
||||
Client *c = NULL, *f;
|
||||
|
||||
if (!selmon->sel)
|
||||
return;
|
||||
f = selmon->sel;
|
||||
if (arg->i > 0) {
|
||||
for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next));
|
||||
if (c){
|
||||
detach(c);
|
||||
attach(c);
|
||||
detachstack(c);
|
||||
attachstack(c);
|
||||
}
|
||||
} else {
|
||||
if ((c = nexttiled(selmon->clients))){
|
||||
detach(c);
|
||||
enqueue(c);
|
||||
detachstack(c);
|
||||
enqueuestack(c);
|
||||
}
|
||||
}
|
||||
if (c){
|
||||
arrange(selmon);
|
||||
focus(f);
|
||||
restack(selmon);
|
||||
}
|
||||
}
|
3
patch/rotatestack.h
Normal file
3
patch/rotatestack.h
Normal file
@ -0,0 +1,3 @@
|
||||
static void enqueue(Client *c);
|
||||
static void enqueuestack(Client *c);
|
||||
static void rotatestack(const Arg *arg);
|
Reference in New Issue
Block a user