shiftview + scrachpads compatibility

pull/251/head
Bakkeby 2 years ago
parent 2ecc15a2ef
commit c553f93b52

@ -8,12 +8,12 @@ shiftview(const Arg *arg)
unsigned int seltagset = selmon->tagset[selmon->seltags]; unsigned int seltagset = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH #endif // SCRATCHPADS_PATCH
if (arg->i > 0) // left circular shift if (arg->i > 0) // left circular shift
shifted.ui = (seltagset << arg->i) shifted.ui = (seltagset << arg->i) | (seltagset >> (NUMTAGS - arg->i));
| (seltagset >> (NUMTAGS - arg->i));
else // right circular shift else // right circular shift
shifted.ui = seltagset >> -arg->i shifted.ui = (seltagset >> -arg->i) | (seltagset << (NUMTAGS + arg->i));
| seltagset << (NUMTAGS + arg->i); #if SCRATCHPADS_PATCH
shifted.ui &= ~SPTAGMASK;
#endif // SCRATCHPADS_PATCH
view(&shifted); view(&shifted);
} }

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

@ -29,23 +29,18 @@ shiftviewclients(const Arg *arg)
#else #else
shifted.ui = selmon->tagset[selmon->seltags]; shifted.ui = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH #endif // SCRATCHPADS_PATCH
if (arg->i > 0) { // left circular shift
do { do {
if (arg->i > 0) // left circular shift
shifted.ui = (shifted.ui << arg->i) shifted.ui = (shifted.ui << arg->i)
| (shifted.ui >> (NUMTAGS - arg->i)); | (shifted.ui >> (NUMTAGS - arg->i));
#if SCRATCHPADS_PATCH else // right circular shift
shifted.ui &= ~SPTAGMASK; shifted.ui = (shifted.ui >> -arg->i)
#endif // SCRATCHPADS_PATCH | (shifted.ui << (NUMTAGS + arg->i));
} while (tagmask && !(shifted.ui & tagmask)); #if SCRATCHPADS_PATCH
} else { // right circular shift shifted.ui &= ~SPTAGMASK;
do { #endif // SCRATCHPADS_PATCH
shifted.ui = (shifted.ui >> (- arg->i) } while (tagmask && !(shifted.ui & tagmask));
| shifted.ui << (NUMTAGS + arg->i));
#if SCRATCHPADS_PATCH
shifted.ui &= ~SPTAGMASK;
#endif // SCRATCHPADS_PATCH
} while (tagmask && !(shifted.ui & tagmask));
}
view(&shifted); view(&shifted);
} }

@ -1,2 +1 @@
static void shiftviewclients(const Arg *arg); static void shiftviewclients(const Arg *arg);

Loading…
Cancel
Save