diff options
| author | bakkeby <[email protected]> | 2020-08-13 15:42:49 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-08-13 15:42:49 +0200 |
| commit | de47bd8839e3a7fc48663b3b530b33fd4042596c (patch) | |
| tree | 6a2f4aba99c94df1bbc78149bf2265448d20ef1b /patch/bar_awesomebar.c | |
| parent | 57e727b498e2916abdd7b819084c01c1db0f641b (diff) | |
| download | dwm-flexipatch-de47bd8839e3a7fc48663b3b530b33fd4042596c.tar.gz dwm-flexipatch-de47bd8839e3a7fc48663b3b530b33fd4042596c.zip | |
Adding bartabgroups patch
Diffstat (limited to 'patch/bar_awesomebar.c')
| -rw-r--r-- | patch/bar_awesomebar.c | 97 |
1 files changed, 3 insertions, 94 deletions
diff --git a/patch/bar_awesomebar.c b/patch/bar_awesomebar.c index 75155fb..d8a11e9 100644 --- a/patch/bar_awesomebar.c +++ b/patch/bar_awesomebar.c @@ -48,13 +48,12 @@ draw_awesomebar(Bar *bar, BarDrawArg *a) #endif // BAR_VTCOLORS_PATCH drw_setscheme(drw, scheme[scm]); - tabw += (i < remainder ? 1 : 0); #if BAR_PANGO_PATCH - drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0, False); + drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, lrpad / 2, c->name, 0, False); #else - drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0); + drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, lrpad / 2, c->name, 0); #endif // BAR_PANGO_PATCH - x += tabw; + x += tabw + (i < remainder ? 1 : 0); } } return a->x + a->w; @@ -84,94 +83,4 @@ click_awesomebar(Bar *bar, Arg *arg, BarClickArg *a) return ClkWinTitle; } return -1; -} - -void -hide(Client *c) { - - Client *n; - if (!c || HIDDEN(c)) - return; - - Window w = c->win; - static XWindowAttributes ra, ca; - - // more or less taken directly from blackbox's hide() function - XGrabServer(dpy); - XGetWindowAttributes(dpy, root, &ra); - XGetWindowAttributes(dpy, w, &ca); - // prevent UnmapNotify events - XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask); - XSelectInput(dpy, w, ca.your_event_mask & ~StructureNotifyMask); - XUnmapWindow(dpy, w); - setclientstate(c, IconicState); - XSelectInput(dpy, root, ra.your_event_mask); - XSelectInput(dpy, w, ca.your_event_mask); - XUngrabServer(dpy); - - if (c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { - for (n = c->snext; n && (!ISVISIBLE(n) || HIDDEN(n)); n = n->snext); - if (!n) - for (n = c->mon->stack; n && (!ISVISIBLE(n) || HIDDEN(n)); n = n->snext); - } else { - n = nexttiled(c); - if (!n) - n = prevtiled(c); - } - focus(n); - arrange(c->mon); -} - -void -show(Client *c) -{ - if (!c || !HIDDEN(c)) - return; - - XMapWindow(dpy, c->win); - setclientstate(c, NormalState); - arrange(c->mon); -} - -void -togglewin(const Arg *arg) -{ - Client *c = (Client*)arg->v; - if (!c) - return; - if (c == selmon->sel) - hide(c); - else { - if (HIDDEN(c)) - show(c); - focus(c); - restack(selmon); - } -} - -Client * -prevtiled(Client *c) -{ - Client *p, *i; - for (p = NULL, i = c->mon->clients; c && i != c; i = i->next) - if (ISVISIBLE(i) && !HIDDEN(i)) - p = i; - return p; -} - -void -showhideclient(const Arg *arg) -{ - Client *c = (Client*)arg->v; - if (!c) - c = selmon->sel; - if (!c) - return; - - if (HIDDEN(c)) { - show(c); - restack(selmon); - } else { - hide(c); - } }
\ No newline at end of file |
