blw = TEXTW(m->ltsymbol)
This commit is contained in:
parent
daf50b59d5
commit
3be6689fd0
15
speedwm.c
15
speedwm.c
|
@ -534,7 +534,8 @@ static char lastbutton[] = "-";
|
||||||
#endif
|
#endif
|
||||||
static int screen;
|
static int screen;
|
||||||
static int tw, sh; /* X display screen geometry width, height */
|
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 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 lrpad; /* sum of left and right padding for text */
|
||||||
static int vp; /* vertical padding for bar */
|
static int vp; /* vertical padding for bar */
|
||||||
|
@ -1014,7 +1015,7 @@ buttonpress(XEvent *e)
|
||||||
occ |= c->tags;
|
occ |= c->tags;
|
||||||
|
|
||||||
if (leftlayout) {
|
if (leftlayout) {
|
||||||
x += blw;
|
x += TEXTW(m->ltsymbol);
|
||||||
} if (ev->x < x && leftlayout) {
|
} if (ev->x < x && leftlayout) {
|
||||||
click = ClkLtSymbol; // left layout
|
click = ClkLtSymbol; // left layout
|
||||||
} else {
|
} else {
|
||||||
|
@ -1033,7 +1034,7 @@ buttonpress(XEvent *e)
|
||||||
#endif
|
#endif
|
||||||
click = ClkTagBar;
|
click = ClkTagBar;
|
||||||
arg.ui = 1 << i;
|
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
|
click = ClkLtSymbol; // right layout
|
||||||
else if (ev->x > selmon->ww - statusw + lrpad - 2 && !hidestatus) {
|
else if (ev->x > selmon->ww - statusw + lrpad - 2 && !hidestatus) {
|
||||||
x = selmon->ww - statusw + lrpad - 2;
|
x = selmon->ww - statusw + lrpad - 2;
|
||||||
|
@ -1058,7 +1059,7 @@ buttonpress(XEvent *e)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!leftlayout) {
|
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
|
// Don't click if title is hidden
|
||||||
|
@ -1789,7 +1790,7 @@ drawbar(Monitor *m)
|
||||||
/* Draw the layout bar on the left if leftlayout = 1 */
|
/* Draw the layout bar on the left if leftlayout = 1 */
|
||||||
/* If colorlayoutnorm = 0, draw using SchemeLayout */
|
/* If colorlayoutnorm = 0, draw using SchemeLayout */
|
||||||
if (leftlayout && !hidelayout) {
|
if (leftlayout && !hidelayout) {
|
||||||
w = blw = TEXTW(m->ltsymbol);
|
w = TEXTW(m->ltsymbol);
|
||||||
drw_setscheme(drw, scheme[SchemeLayout]);
|
drw_setscheme(drw, scheme[SchemeLayout]);
|
||||||
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
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 */
|
/* Draw the layout bar on the right if leftlayout is not 0 */
|
||||||
/* If colorlayoutnorm = 0, draw using SchemeLayout */
|
/* If colorlayoutnorm = 0, draw using SchemeLayout */
|
||||||
if (!leftlayout && !hidelayout) {
|
if (!leftlayout && !hidelayout) {
|
||||||
w = blw = TEXTW(m->ltsymbol);
|
w = TEXTW(m->ltsymbol);
|
||||||
drw_setscheme(drw, scheme[SchemeLayout]);
|
drw_setscheme(drw, scheme[SchemeLayout]);
|
||||||
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
||||||
}
|
}
|
||||||
|
@ -2826,7 +2827,7 @@ motionnotify(XEvent *e)
|
||||||
else
|
else
|
||||||
occ |= c->tags;
|
occ |= c->tags;
|
||||||
if (leftlayout)
|
if (leftlayout)
|
||||||
x += blw;
|
x += TEXTW(m->ltsymbol);
|
||||||
do {
|
do {
|
||||||
if (!(occ & 1 << i || selmon->tagset[selmon->seltags] & 1 << i) && hideemptytags)
|
if (!(occ & 1 << i || selmon->tagset[selmon->seltags] & 1 << i) && hideemptytags)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue