diff --git a/slock.c b/slock.c index 583d9e1..df3a43f 100644 --- a/slock.c +++ b/slock.c @@ -486,7 +486,7 @@ static void render_screen(struct arena *arena, Display *dpy, struct lock **locks, FT_Face main_font_face, FT_Face secondary_font_face, - unsigned int pass_len, int failure) + unsigned int pass_len, int failure, int locked) { XWindowAttributes attrs; if(XGetWindowAttributes(dpy, locks[0]->win, &attrs)) { @@ -534,7 +534,7 @@ render_screen(struct arena *arena, message_str = (char *)arena_alloc(&temp_arena, message_str_len); if(failure) memcpy(message_str, "wrong password", 15); - else + else if(locked) memcpy(message_str, "locked", 7); if(pass_len > 0) { unsigned int i; @@ -626,7 +626,7 @@ readpw(struct arena *arena, { XRRScreenChangeNotifyEvent *rre; char buf[32], passwd[256], *inputhash; - int num, screen, running, failure, oldc, i, passing, dson, tfd, xfd; + int num, screen, running, failure, locked, oldc, i, passing, dson, tfd, xfd; unsigned int len, color; struct timeval tv; KeySym ksym; @@ -641,6 +641,7 @@ readpw(struct arena *arena, len = 0; running = 1; failure = 0; + locked = 1; oldc = INIT; dson = 1; @@ -749,6 +750,8 @@ readpw(struct arena *arena, if (running) { XBell(dpy, 100); failure = 1; + } else { + locked = 0; } explicit_bzero(&passwd, sizeof(passwd)); len = 0; @@ -807,7 +810,7 @@ readpw(struct arena *arena, render_screen(arena, dpy, locks, fonts.main_face, fonts.secondary_face, - len, failure); + len, failure, locked); if(millis() - rendering_timeout_millis >= 500) { needs_rendering = 0;