diff options
| author | SoominIm <111330163+SoominIm@users.noreply.github.com> | 2024-04-06 20:26:03 -0500 |
|---|---|---|
| committer | SoominIm <111330163+SoominIm@users.noreply.github.com> | 2024-04-06 20:26:03 -0500 |
| commit | 6b71c978fd56367f0fb339d4039896ed2af0cb0b (patch) | |
| tree | 86fb89a7c4f5a999752f5a0c95c4c479bdd55f1a /dwm/shiftview.c | |
| parent | 3588cbd9e548351ac37ca8946f93c4603d6b7307 (diff) | |
Updates dwm, st, dmenu, slock, and dwmblocks
Diffstat (limited to 'dwm/shiftview.c')
| -rw-r--r-- | dwm/shiftview.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/dwm/shiftview.c b/dwm/shiftview.c deleted file mode 100644 index bb43969..0000000 --- a/dwm/shiftview.c +++ /dev/null @@ -1,65 +0,0 @@ -/** Function to shift the current view to the left/right - * - * @param: "arg->i" stores the number of tags to shift right (positive value) - * or left (negative value) - */ -void -shiftview(const Arg *arg) -{ - Arg shifted; - Client *c; - unsigned int tagmask = 0; - - for (c = selmon->clients; c; c = c->next) - if (!(c->tags & SPTAGMASK)) - tagmask = tagmask | c->tags; - - shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; - if (arg->i > 0) /* left circular shift */ - do { - shifted.ui = (shifted.ui << arg->i) - | (shifted.ui >> (LENGTH(tags) - arg->i)); - shifted.ui &= ~SPTAGMASK; - } while (tagmask && !(shifted.ui & tagmask)); - else /* right circular shift */ - do { - shifted.ui = (shifted.ui >> (- arg->i) - | shifted.ui << (LENGTH(tags) + arg->i)); - shifted.ui &= ~SPTAGMASK; - } while (tagmask && !(shifted.ui & tagmask)); - - view(&shifted); -} - -void -shifttag(const Arg *arg) -{ - Arg a; - Client *c; - unsigned visible = 0; - int i = arg->i; - int count = 0; - int nextseltags, curseltags = selmon->tagset[selmon->seltags]; - - do { - if(i > 0) // left circular shift - nextseltags = (curseltags << i) | (curseltags >> (LENGTH(tags) - i)); - - else // right circular shift - nextseltags = (curseltags >> - i) | (curseltags << (LENGTH(tags) + i)); - - // Check if tag is visible - for (c = selmon->clients; c && !visible; c = c->next) - if (nextseltags & c->tags) { - visible = 1; - break; - } - i += arg->i; - } while (!visible && ++count < 10); - - if (count < 10) { - a.i = nextseltags; - tag(&a); - } -} - |
