Added shiftview patch

This commit is contained in:
bakkeby
2020-01-29 14:22:24 +01:00
parent 347ac5146c
commit d644c89c74
7 changed files with 36 additions and 1 deletions

View File

@@ -88,6 +88,9 @@
#if SETBORDERPX_PATCH
#include "setborderpx.c"
#endif
#if SHIFTVIEW_PATCH
#include "shiftview.c"
#endif
#if SORTSCREENS_PATCH
#ifdef XINERAMA
#include "sortscreens.c"

View File

@@ -88,6 +88,9 @@
#if SETBORDERPX_PATCH
#include "setborderpx.h"
#endif
#if SHIFTVIEW_PATCH
#include "shiftview.h"
#endif
#if SORTSCREENS_PATCH
#ifdef XINERAMA
#include "sortscreens.h"

15
patch/shiftview.c Normal file
View File

@@ -0,0 +1,15 @@
void
shiftview(const Arg *arg)
{
Arg shifted;
if(arg->i > 0) // left circular shift
shifted.ui = (selmon->tagset[selmon->seltags] << arg->i)
| (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i));
else // right circular shift
shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i)
| selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i);
view(&shifted);
}

1
patch/shiftview.h Normal file
View File

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