From ae96605fcdc35237ba10fe2c431830fe6ddd6c8f Mon Sep 17 00:00:00 2001 From: speedie Date: Sat, 29 Apr 2023 16:08:00 +0200 Subject: [PATCH] fix some wacky stuff --- libs/draw.c | 7 +++---- spmenu.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/draw.c b/libs/draw.c index fa2d2f0..5ab95e1 100644 --- a/libs/draw.c +++ b/libs/draw.c @@ -280,7 +280,7 @@ drawinput(int x, int y, int w) // draw input drw_setscheme(drw, scheme[SchemeInput]); - if (passwd && !hideprompt) { + if (passwd) { censort = ecalloc(1, sizeof(text)); for (int i = 0; i < strlen(text); i++) @@ -292,14 +292,14 @@ drawinput(int x, int y, int w) curpos = TEXTW(censort) - TEXTW(&text[cursor]); free(censort); - } else if (!passwd && !hideprompt) { + } else if (!passwd) { apply_fribidi(text); drw_text(drw, x, y, w, bh, lrpad / 2, isrtl ? fribidi_text : text, 0, pango_input ? True : False); curpos = TEXTW(text) - TEXTW(&text[cursor]); } - if ((curpos += lrpad / 2 - 1) < w && !hidecaret && !hideprompt && cursorstate) { + if ((curpos += lrpad / 2 - 1) < w && !hidecaret && cursorstate) { drw_setscheme(drw, scheme[SchemeCaret]); drw_rect(drw, x + curpos, 2 + (bh - fh) / 2 + y, 2, fh - 4, 1, 0); } @@ -474,7 +474,6 @@ drawmenu(void) x = drawinput(x, y, w); } - if (!hidemode) modeWidth = pango_mode ? TEXTWM(modetext) : TEXTW(modetext); // draw the items, this function also calls drawrarrow() and drawlarrow() diff --git a/spmenu.c b/spmenu.c index 4a2ac43..24a3171 100644 --- a/spmenu.c +++ b/spmenu.c @@ -132,7 +132,7 @@ static int plw = 0; static int lrpad; // sum of left and right padding static int vp; // vertical padding for bar static int sp; // side padding for bar -static int cursorstate = 0; // cursor state +static int cursorstate = 1; // cursor state static size_t cursor; static struct item *items = NULL, *backup_items; static struct item *matches, *matchend;