Tag-Sync patch (for syncing tags across all monitors) (#219)

* Tag-Sync patch
* Major compatibility updates
* SWITCHTAG/TAGSYNC compatibility
* tagsync: refactoring

Co-authored-by: bakkeby <bakkeby@gmail.com>
This commit is contained in:
Bagellll
2022-02-11 10:57:53 -05:00
committed by GitHub
parent 8f986a4e3b
commit ae67378b20
10 changed files with 135 additions and 109 deletions

View File

@ -5,7 +5,11 @@ shiftviewclients(const Arg *arg)
Client *c;
unsigned int tagmask = 0;
for (c = selmon->clients; c; c = c->next)
#if TAGSYNC_PATCH
Monitor *origselmon = selmon;
for (selmon = mons; selmon; selmon = selmon->next)
#endif // TAGSYNC_PATCH
for (c = selmon->clients; c; c = c->next) {
#if SCRATCHPADS_PATCH
if (!(c->tags & SPTAGMASK))
tagmask = tagmask | c->tags;
@ -15,13 +19,17 @@ shiftviewclients(const Arg *arg)
#else
tagmask = tagmask | c->tags;
#endif // SCRATCHPADS_PATCH
}
#if TAGSYNC_PATCH
selmon = origselmon;
#endif // TAGSYNC_PATCH
#if SCRATCHPADS_PATCH
shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
#else
shifted.ui = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH
if (arg->i > 0) // left circular shift
if (arg->i > 0) { // left circular shift
do {
shifted.ui = (shifted.ui << arg->i)
| (shifted.ui >> (NUMTAGS - arg->i));
@ -29,7 +37,7 @@ shiftviewclients(const Arg *arg)
shifted.ui &= ~SPTAGMASK;
#endif // SCRATCHPADS_PATCH
} while (tagmask && !(shifted.ui & tagmask));
else // right circular shift
} else { // right circular shift
do {
shifted.ui = (shifted.ui >> (- arg->i)
| shifted.ui << (NUMTAGS + arg->i));
@ -37,6 +45,7 @@ shiftviewclients(const Arg *arg)
shifted.ui &= ~SPTAGMASK;
#endif // SCRATCHPADS_PATCH
} while (tagmask && !(shifted.ui & tagmask));
}
view(&shifted);
}