diff options
| author | Bagellll <[email protected]> | 2022-02-11 10:57:53 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-11 16:57:53 +0100 |
| commit | ae67378b200842998bb4bc178e0d67220f09fefc (patch) | |
| tree | 9da48cb032d37b646a0b93d954fe5b7942f9cf96 /patch/shiftviewclients.c | |
| parent | 8f986a4e3b64533d9d96272941685a314f3fa837 (diff) | |
| download | dwm-flexipatch-ae67378b200842998bb4bc178e0d67220f09fefc.tar.gz dwm-flexipatch-ae67378b200842998bb4bc178e0d67220f09fefc.zip | |
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 <[email protected]>
Diffstat (limited to 'patch/shiftviewclients.c')
| -rw-r--r-- | patch/shiftviewclients.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/patch/shiftviewclients.c b/patch/shiftviewclients.c index 1bf9de8..b805b51 100644 --- a/patch/shiftviewclients.c +++ b/patch/shiftviewclients.c @@ -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); } |
