From: Jason Woofenden Date: Mon, 5 Mar 2018 19:42:53 +0000 (-0500) Subject: topbar only over master, slaves are same height as master X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=commitdiff_plain;h=fc549bcad10b7508c78a499c8fa3ccd9670621db topbar only over master, slaves are same height as master --- diff --git a/dwm.c b/dwm.c index 3d42441..d8e2402 100644 --- a/dwm.c +++ b/dwm.c @@ -654,7 +654,7 @@ configurenotify(XEvent *e) { drw_resize(drw, sw, bh); updatebars(); for(m = mons; m; m = m->next) - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); + XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww * m->mfact, bh); focus(NULL); arrange(NULL); } @@ -814,10 +814,10 @@ drawbar(Monitor *m) { xx = x; if(m == selmon) { /* status is only drawn on selected monitor */ w = TEXTW(stext); - x = m->ww - w; + x = m->ww * m->mfact - w; if(x < xx) { x = xx; - w = m->ww - xx; + w = m->ww* m->mfact - xx; } drw_text(drw, x, 0, w, bh, stext, 0); } @@ -829,8 +829,7 @@ drawbar(Monitor *m) { drw_setscheme(drw, m == selmon ? &scheme[SchemeSel] : &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, m->sel->name, 0); drw_rect(drw, x, 0, w, bh, m->sel->isfixed, m->sel->isfloating, 0); - } - else { + } else { drw_setscheme(drw, &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, NULL, 0); } @@ -1817,9 +1816,9 @@ tile(Monitor *m) { } } -#define TAB_HEIGHT 19 -#define TAB_PAD 7 -#define GUTTER_PX 8 +#define GUTTER_PX 4 +#define TAB_HEIGHT (bh / 2 - GUTTER_PX) +#define TAB_PAD GUTTER_PX void jason_layout(Monitor *m) { @@ -1857,20 +1856,34 @@ jason_layout(Monitor *m) { } right_width = m->ww - mw - GUTTER_PX; tab_count = &(tab_counts[0]); - tab_top = m->wy - (m->wh - (2 * (TAB_HEIGHT + TAB_PAD))) + TAB_HEIGHT; + tab_top = m->my - m->wh + TAB_HEIGHT; for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { if (i == 0) { resize(c, m->wx, m->wy, mw, m->wh, False, 0); } else { if (c == vis_slave) { - resize(c, m->wx + mw + GUTTER_PX, m->wy + TAB_HEIGHT + TAB_PAD, right_width, m->wh - 2 * (TAB_HEIGHT + TAB_PAD), False, base); + resize(c, + m->wx + mw + GUTTER_PX, + m->my + TAB_HEIGHT + TAB_PAD, + right_width, + m->wh, + False, + base + ); tab_count = &(tab_counts[1]); - tab_top = m->wy + m->wh - TAB_HEIGHT; + tab_top = m->my + m->mh - TAB_HEIGHT; cur_tab = 0; } else { // this function does not get called when focus changes // resize(c, m->wx + m->ww, m->wy, m->ww - mw, m->wh, False); - resize(c, m->wx + mw + GUTTER_PX + right_width * cur_tab / (*tab_count), tab_top, right_width, m->wh - 2 * (TAB_HEIGHT + TAB_PAD), False, base); + resize(c, + m->wx + mw + GUTTER_PX + right_width * cur_tab / (*tab_count), + tab_top, + right_width, + m->wh, + False, + base + ); cur_tab += 1; } } @@ -1985,7 +1998,7 @@ updatebars(void) { for(m = mons; m; m = m->next) { if (m->barwin) continue; - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), + m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww * m->mfact, bh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); XChangeProperty(dpy, root, netatom[NetSupportingWMCheck], XA_WINDOW, 32,