--- slock.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/slock.c b/slock.c index c9cdee2..48f917f 100644 --- a/slock.c +++ b/slock.c _AT_@ -125,6 +125,7 @@ readpw(Display *dpy, const char *pws) KeySym ksym; XEvent ev; static int oldc = INIT; + Bool reset = False; len = 0; running = True; _AT_@ -165,6 +166,7 @@ readpw(Display *dpy, const char *pws) break; case XK_Escape: len = 0; + reset = True; break; case XK_BackSpace: if (len) _AT_@ -177,7 +179,12 @@ readpw(Display *dpy, const char *pws) } break; } - color = len ? INPUT : (failure || failonclear ? FAILED : INIT); + if (reset) { + color = INIT; + reset = False; + } else { + color = len ? INPUT : (failure || failonclear ? FAILED : INIT); + } if (running && oldc != color) { for (screen = 0; screen < nscreens; screen++) { XSetWindowBackground(dpy, locks[screen]->win, locks[screen]->colors[color]); -- 2.8.0Received on Mon Apr 04 2016 - 07:46:18 CEST
This archive was generated by hypermail 2.3.0 : Mon Apr 04 2016 - 07:48:16 CEST