diff --git a/patch/shiftviewclients.c b/patch/shiftviewclients.c new file mode 100644 index 0000000..c3122b0 --- /dev/null +++ b/patch/shiftviewclients.c @@ -0,0 +1,24 @@ +void +shiftviewclients(const Arg *arg) +{ + Arg shifted; + Client *c; + unsigned int tagmask = 0; + + for (c = selmon->clients; c; c = c->next) + tagmask = tagmask | c->tags; + + shifted.ui = selmon->tagset[selmon->seltags]; + if (arg->i > 0) // left circular shift + do { + shifted.ui = (shifted.ui << arg->i) + | (shifted.ui >> (LENGTH(tags) - arg->i)); + } while (tagmask && !(shifted.ui & tagmask)); + else // right circular shift + do { + shifted.ui = (shifted.ui >> (- arg->i) + | shifted.ui << (LENGTH(tags) + arg->i)); + } while (tagmask && !(shifted.ui & tagmask)); + + view(&shifted); +} \ No newline at end of file diff --git a/patch/shiftviewclients.h b/patch/shiftviewclients.h new file mode 100644 index 0000000..ddff826 --- /dev/null +++ b/patch/shiftviewclients.h @@ -0,0 +1 @@ +static void shiftviewclients(const Arg *arg); \ No newline at end of file