From a6c2fe5668ca780f865b6cfac72ea94e1c93d881 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Tue, 5 May 2020 19:54:02 +0200 Subject: [PATCH] Adding shiftviewclients files --- patch/shiftviewclients.c | 24 ++++++++++++++++++++++++ patch/shiftviewclients.h | 1 + 2 files changed, 25 insertions(+) create mode 100644 patch/shiftviewclients.c create mode 100644 patch/shiftviewclients.h 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