From 995dd8bfb84aa98baa6373158294de5bc60f8312 Mon Sep 17 00:00:00 2001 From: speediegq Date: Thu, 8 Sep 2022 16:03:56 +0200 Subject: [PATCH] Fix hide* integers --- speedwm.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/speedwm.c b/speedwm.c index ab9c797..ecae5dc 100644 --- a/speedwm.c +++ b/speedwm.c @@ -1019,9 +1019,11 @@ buttonpress(XEvent *e) do { if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) continue; - x += TEXTW(occ & 1 << i ? usedtags[i] : tags[i]); + if (!hidetags) + x += TEXTW(occ & 1 << i ? usedtags[i] : tags[i]); + } while (ev->x >= x && ++i < LENGTH(tags)); - if (i < LENGTH(tags)) { + if (i < LENGTH(tags) && !hidetags) { selmon->mouseactivated = 1; click = ClkTagBar; arg.ui = 1 << i; @@ -1052,6 +1054,10 @@ buttonpress(XEvent *e) if (!leftlayout) { x += blw; // Left layout does not need this } + + // Don't click if title is hidden + // This is not required, but you won't be able to see what you're clicking so we might as well disable it + if (!hidetitle) { c = m->clients; if (c) { @@ -1065,6 +1071,7 @@ buttonpress(XEvent *e) click = ClkWinTitle; arg.v = c; } + } } } @@ -1751,8 +1758,6 @@ drawbar(Monitor *m) tw = statusw = m->ww - drawstatusbar(m, bh, stext); } - //x = 0; - for (text = s = stext; *s; s++) { if ((unsigned char)(*s) < ' ') { ch = *s; @@ -1770,7 +1775,7 @@ drawbar(Monitor *m) if (ISVISIBLE(c)) n++; occ |= c->tags; - if (c->isurgent) + if (c->isurgent && !hidetags) urg |= c->tags; } @@ -1782,13 +1787,13 @@ drawbar(Monitor *m) x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); } + if (!hidetags) { for (i = 0; i < LENGTH(tags); i++) { if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) continue; - tagtext = occ & 1 << i ? usedtags[i] : tags[i]; if (!hidetags) { + tagtext = occ & 1 << i ? usedtags[i] : tags[i]; w = TEXTW(tagtext); - } drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeTags])); drw_text(drw, x, 0, w, bh, lrpad / 2, tagtext, urg & 1 << i); @@ -1799,6 +1804,8 @@ drawbar(Monitor *m) x += w; } + } + } #if LAYOUT_MONOCLE if (monoclecount) { @@ -4834,10 +4841,11 @@ void updatestatus(void) { Monitor* m; - if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) { + if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext)) && !hidestatus) { strcpy(stext, defaultname); statusw = TEXTW(stext) - lrpad + 2; } else { + if (!hidestatus) { copyvalidchars(stext, rawstext); char *text, *s, ch; statusw = 0; @@ -4852,6 +4860,7 @@ updatestatus(void) } statusw += TEXTW(text) - lrpad + 2; } + } if (statusallmons) { for(m = mons; m; m = m->next) drawbar(m);