diff options
author | Joe <bousset.rudy@gmail.com> | 2022-08-17 20:04:18 +0200 |
---|---|---|
committer | Joe <bousset.rudy@gmail.com> | 2022-08-17 20:04:18 +0200 |
commit | 1bdef2640b6990a27ff12f9e87fa8ac1e34d1287 (patch) | |
tree | af6b57af048912b5f5ef74be842d337440b4f41a /dwm.c | |
parent | update (diff) | |
download | dwm-1bdef2640b6990a27ff12f9e87fa8ac1e34d1287.tar.gz dwm-1bdef2640b6990a27ff12f9e87fa8ac1e34d1287.tar.bz2 dwm-1bdef2640b6990a27ff12f9e87fa8ac1e34d1287.tar.xz dwm-1bdef2640b6990a27ff12f9e87fa8ac1e34d1287.tar.zst dwm-1bdef2640b6990a27ff12f9e87fa8ac1e34d1287.zip |
removed bartabgroups
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 112 |
1 files changed, 11 insertions, 101 deletions
@@ -60,7 +60,7 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel, SchemeTabActive, SchemeTabInactive }; /* color schemes */ +enum { SchemeNorm, SchemeSel }; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ @@ -410,98 +410,6 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) } void -bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive) { - if (!c) return; - int i, nclienttags = 0, nviewtags = 0; - - drw_setscheme(drw, scheme[ - m->sel == c ? SchemeSel : (groupactive ? SchemeTabActive: SchemeTabInactive) - ]); - drw_text(drw, x, 0, w, bh, lrpad / 2, c->name, 0); - - // Floating win indicator - if (c->isfloating) drw_rect(drw, x + 2, 2, 5, 5, 0, 0); - - // Optional borders between tabs - if (BARTAB_BORDERS) { - XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBorder].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, 0, 1, bh); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w, 0, 1, bh); - } - - // Optional tags icons - for (i = 0; i < LENGTH(tags); i++) { - if ((m->tagset[m->seltags] >> i) & 1) { nviewtags++; } - if ((c->tags >> i) & 1) { nclienttags++; } - } - if (BARTAB_TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) { - for (i = 0; i < LENGTH(tags); i++) { - drw_rect(drw, - ( x + w - 2 - ((LENGTH(tags) / BARTAB_TAGSROWS) * BARTAB_TAGSPX) - - (i % (LENGTH(tags)/BARTAB_TAGSROWS)) + ((i % (LENGTH(tags) / BARTAB_TAGSROWS)) * BARTAB_TAGSPX) - ), - ( 2 + ((i / (LENGTH(tags)/BARTAB_TAGSROWS)) * BARTAB_TAGSPX) - - ((i / (LENGTH(tags)/BARTAB_TAGSROWS))) - ), - BARTAB_TAGSPX, BARTAB_TAGSPX, (c->tags >> i) & 1, 0 - ); - } - } -} - -void -battabclick(Monitor *m, Client *c, int passx, int x, int w, int unused) { - if (passx >= x && passx <= x + w) { - focus(c); - restack(selmon); - } -} - -void -bartabcalculate( - Monitor *m, int offx, int sw, int passx, - void(*tabfn)(Monitor *, Client *, int, int, int, int) -) { - Client *c; - int - i, clientsnmaster = 0, clientsnstack = 0, clientsnfloating = 0, - masteractive = 0, fulllayout = 0, floatlayout = 0, - x, w, tgactive; - - for (i = 0, c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c)) continue; - if (c->isfloating) { clientsnfloating++; continue; } - if (m->sel == c) { masteractive = i < m->nmaster; } - if (i < m->nmaster) { clientsnmaster++; } else { clientsnstack++; } - i++; - } - for (i = 0; i < LENGTH(bartabfloatfns); i++) if (m ->lt[m->sellt]->arrange == bartabfloatfns[i]) { floatlayout = 1; break; } - for (i = 0; i < LENGTH(bartabmonfns); i++) if (m ->lt[m->sellt]->arrange == bartabmonfns[i]) { fulllayout = 1; break; } - for (c = m->clients, i = 0; c; c = c->next) { - if (!ISVISIBLE(c)) continue; - if (clientsnmaster + clientsnstack == 0 || floatlayout) { - x = offx + (((m->mw - offx - sw) / (clientsnmaster + clientsnstack + clientsnfloating)) * i); - w = (m->mw - offx - sw) / (clientsnmaster + clientsnstack + clientsnfloating); - tgactive = 1; - } else if (!c->isfloating && (fulllayout || ((clientsnmaster == 0) ^ (clientsnstack == 0)))) { - x = offx + (((m->mw - offx - sw) / (clientsnmaster + clientsnstack)) * i); - w = (m->mw - offx - sw) / (clientsnmaster + clientsnstack); - tgactive = 1; - } else if (i < m->nmaster && !c->isfloating) { - x = offx + ((((m->mw * m->mfact) - offx) /clientsnmaster) * i); - w = ((m->mw * m->mfact) - offx) / clientsnmaster; - tgactive = masteractive; - } else if (!c->isfloating) { - x = (m->mw * m->mfact) + ((((m->mw * (1 - m->mfact)) - sw) / clientsnstack) * (i - m->nmaster)); - w = ((m->mw * (1 - m->mfact)) - sw) / clientsnstack; - tgactive = !masteractive; - } else continue; - tabfn(m, c, passx, x, w, tgactive); - i++; - } -} - -void arrange(Monitor *m) { if (m) @@ -599,8 +507,8 @@ buttonpress(XEvent *e) click = ClkLtSymbol; else if (ev->x > selmon->ww - (int)TEXTW(stext)) click = ClkStatusText; - else // Focus clicked tab bar item - bartabcalculate(selmon, x, TEXTW(stext) - lrpad + 2, ev->x, battabclick); + else + click = ClkWinTitle; } else if ((c = wintoclient(ev->window))) { if (focusonwheel || (ev->button != Button4 && ev->button != Button5)) focus(c); @@ -909,13 +817,15 @@ drawbar(Monitor *m) drw_setscheme(drw, scheme[SchemeNorm]); x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - // Draw bartabgroups - drw_rect(drw, x, 0, m->ww - tw - x, bh, 1, 1); if ((w = m->ww - tw - x) > bh) { - bartabcalculate(m, x, tw, -1, bartabdraw); - if (BARTAB_BOTTOMBORDER) { - drw_setscheme(drw, scheme[SchemeTabActive]); - drw_rect(drw, 0, bh - 1, m->ww, 1, 1, 0); + if (m->sel) { + drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); + drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); + if (m->sel->isfloating) + drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); + } else { + drw_setscheme(drw, scheme[SchemeNorm]); + drw_rect(drw, x, 0, w, bh, 1, 1); } } drw_map(drw, m->barwin, 0, 0, m->ww, bh); |