diff options
| author | bakkeby <[email protected]> | 2020-08-20 13:30:12 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-08-20 13:30:12 +0200 |
| commit | a085c788e313db693d35feefe1f6dfa1e5daf440 (patch) | |
| tree | 61ec928f1c4205b31b25aa74ee8e2fb84c130977 /patch/bar_wintitle_hidden.c | |
| parent | c7b84ec738e7b1c1d1110f86bff38f95cf953a49 (diff) | |
| download | dwm-flexipatch-a085c788e313db693d35feefe1f6dfa1e5daf440.tar.gz dwm-flexipatch-a085c788e313db693d35feefe1f6dfa1e5daf440.zip | |
Adding experimental flexwintitle patch based on bartabgroups
Diffstat (limited to 'patch/bar_wintitle_hidden.c')
| -rw-r--r-- | patch/bar_wintitle_hidden.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/patch/bar_wintitle_hidden.c b/patch/bar_wintitle_hidden.c new file mode 100644 index 0000000..729f6aa --- /dev/null +++ b/patch/bar_wintitle_hidden.c @@ -0,0 +1,44 @@ +int +width_wintitle_hidden(Bar *bar, BarWidthArg *a) +{ + return a->max_width; +} + +int +draw_wintitle_hidden(Bar *bar, BarDrawArg *a) +{ + drw_rect(drw, a->x, 0, a->w, bh, 1, 1); + calc_wintitle_hidden(bar->mon, a->x, a->w, -1, flextitledraw, NULL); + return a->x + a->w; +} + +int +click_wintitle_hidden(Bar *bar, Arg *arg, BarClickArg *a) +{ + calc_wintitle_hidden(bar->mon, 0, a->rel_w, a->rel_x, flextitleclick, arg); + return ClkWinTitle; +} + +void +calc_wintitle_hidden( + Monitor *m, int offx, int tabw, int passx, + void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg), Arg *arg +) { + Client *c; + int clientsnhidden = 0, w, r; + int groupactive = GRP_HIDDEN; + + for (c = m->clients; c; c = c->next) { + if (!ISVISIBLE(c)) + continue; + if (HIDDEN(c)) + clientsnhidden++; + } + + if (!clientsnhidden) + return; + + w = tabw / clientsnhidden; + r = tabw % clientsnhidden; + c = flextitledrawarea(m, m->clients, offx, r, w, clientsnhidden, SCHEMEFOR(GRP_HIDDEN), 0, 1, 0, passx, tabfn, arg); +}
\ No newline at end of file |
