blw = TEXTW(m->ltsymbol)
This commit is contained in:
speediegq 2022-09-10 23:45:37 +02:00
parent daf50b59d5
commit 3be6689fd0

View file

@ -534,7 +534,8 @@ static char lastbutton[] = "-";
#endif
static int screen;
static int tw, sh; /* X display screen geometry width, height */
static int bh, blw = 0; /* bar geometry */
static int bh; /* bar geometry */
// NOTE: Implemented https://git.suckless.org/dwm/commit/5799dd1fca6576b662d299e210cd5933b29d502d.html
static int unmanaged = 0; /* whether the window manager should manage the new window or not */
static int lrpad; /* sum of left and right padding for text */
static int vp; /* vertical padding for bar */
@ -1014,7 +1015,7 @@ buttonpress(XEvent *e)
occ |= c->tags;
if (leftlayout) {
x += blw;
x += TEXTW(m->ltsymbol);
} if (ev->x < x && leftlayout) {
click = ClkLtSymbol; // left layout
} else {
@ -1033,7 +1034,7 @@ buttonpress(XEvent *e)
#endif
click = ClkTagBar;
arg.ui = 1 << i;
} else if (ev->x < x + blw && !leftlayout) // right layout
} else if (ev->x < x + TEXTW(selmon->ltsymbol) && !leftlayout) // right layout
click = ClkLtSymbol; // right layout
else if (ev->x > selmon->ww - statusw + lrpad - 2 && !hidestatus) {
x = selmon->ww - statusw + lrpad - 2;
@ -1058,7 +1059,7 @@ buttonpress(XEvent *e)
}
} else {
if (!leftlayout) {
x += blw; // Left layout does not need this
x += TEXTW(m->ltsymbol);; // Left layout does not need this
}
// Don't click if title is hidden
@ -1789,7 +1790,7 @@ drawbar(Monitor *m)
/* Draw the layout bar on the left if leftlayout = 1 */
/* If colorlayoutnorm = 0, draw using SchemeLayout */
if (leftlayout && !hidelayout) {
w = blw = TEXTW(m->ltsymbol);
w = TEXTW(m->ltsymbol);
drw_setscheme(drw, scheme[SchemeLayout]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
}
@ -1830,7 +1831,7 @@ drawbar(Monitor *m)
/* Draw the layout bar on the right if leftlayout is not 0 */
/* If colorlayoutnorm = 0, draw using SchemeLayout */
if (!leftlayout && !hidelayout) {
w = blw = TEXTW(m->ltsymbol);
w = TEXTW(m->ltsymbol);
drw_setscheme(drw, scheme[SchemeLayout]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
}
@ -2826,7 +2827,7 @@ motionnotify(XEvent *e)
else
occ |= c->tags;
if (leftlayout)
x += blw;
x += TEXTW(m->ltsymbol);
do {
if (!(occ & 1 << i || selmon->tagset[selmon->seltags] & 1 << i) && hideemptytags)
continue;