From 23cbc819b9eca634e2453e8a211b1e4b661d67e5 Mon Sep 17 00:00:00 2001 From: Saif Shahriar Date: Wed, 18 Sep 2024 19:30:54 +0000 Subject: [PATCH 1/2] Fix SYMBOLS_PATCH not changing right symbol "<" (#32) SYMBOLS_PATCH supposed to change "<" and ">". Although, it does replaces ">" with a user defined glyph, it does not do the same for "<". This commit fixes that. --- dmenu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dmenu.c b/dmenu.c index 65bf5ab..8b08b35 100644 --- a/dmenu.c +++ b/dmenu.c @@ -647,10 +647,18 @@ drawmenu(void) } else if (matches) { /* draw horizontal list */ x += inputw; + #if SYMBOLS_PATCH + w = TEXTW(symbol_1); + #else w = TEXTW("<"); + #endif // SYMBOLS_PATCH if (curr->left) { drw_setscheme(drw, scheme[SchemeNorm]); + #if SYMBOLS_PATCH + drw_text(drw, x, 0, w, bh, lrpad / 2, symbol_1, 0 + #else drw_text(drw, x, 0, w, bh, lrpad / 2, "<", 0 + #endif // SYMBOLS_PATCH #if PANGO_PATCH , True #endif // PANGO_PATCH From 43f0483d5a0bd854d5e405d84d4a566728e1a958 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Thu, 19 Sep 2024 09:31:45 +0200 Subject: [PATCH 2/2] scroll: compatibility fix wrt upstream utf8decode overhaul changes #33 --- patch/scroll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patch/scroll.c b/patch/scroll.c index a039579..46f597f 100644 --- a/patch/scroll.c +++ b/patch/scroll.c @@ -25,6 +25,7 @@ drw_text_align(Drw *drw, int x, int y, unsigned int w, unsigned int h, const cha FcPattern *match; XftResult result; int charexists = 0; + int utf8err = 0; int i, n; if (!drw || (render && !drw->scheme) || !text || !drw->fonts || textlen <= 0 @@ -56,14 +57,14 @@ drw_text_align(Drw *drw, int x, int y, unsigned int w, unsigned int h, const cha while ((align == AlignL && i < textlen) || (align == AlignR && i > 0)) { if (align == AlignL) { - utf8charlen = utf8decode(text + i, &utf8codepoint, MIN(textlen - i, UTF_SIZ)); + utf8charlen = utf8decode(text + i, &utf8codepoint, &utf8err); if (!utf8charlen) { textlen = i; break; } } else { n = utf8nextchar(text, textlen, i, -1); - utf8charlen = utf8decode(text + n, &utf8codepoint, MIN(textlen - n, UTF_SIZ)); + utf8charlen = utf8decode(text + n, &utf8codepoint, &utf8err); if (!utf8charlen) { textlen -= i; text += i;