diff options
| author | Andrew <saintruler@gmail.com> | 2020-06-05 13:48:02 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2020-06-05 13:48:02 +0400 |
| commit | eb9b7e135d71bf3c534fa1143037c58cb5553c55 (patch) | |
| tree | 154c1afd4a5734a548ddecf9e31b4b0aef0ea9cd /dwm.c | |
| parent | 588bb80ca4c11471c31d7d516ba39da5b6b6dca8 (diff) | |
Added function scrollview
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -262,6 +262,7 @@ static void updatetitle(Client *c); static void updatewindowtype(Client *c); static void updatewmhints(Client *c); static void view(const Arg *arg); +static void scrollview(const Arg *arg); static Client *wintoclient(Window w); static Monitor *wintomon(Window w); static Client *wintosystrayicon(Window w); @@ -2408,6 +2409,24 @@ view(const Arg *arg) arrange(selmon); } +void +scrollview(const Arg *arg) +{ + int ui = 0; + if (arg->i < 0) + ui = selmon->tagset[selmon->seltags] >> 1; + else if (arg->i > 0) + ui = selmon->tagset[selmon->seltags] << 1; + + if ((ui & TAGMASK) == 0 || (ui & TAGMASK) == selmon->tagset[selmon->seltags]) + return; + selmon->seltags ^= 1; /* toggle sel tagset */ + if (ui & TAGMASK) + selmon->tagset[selmon->seltags] = ui; + focus(NULL); + arrange(selmon); +} + Client * wintoclient(Window w) { |