First press of ESC key clear the password, then offs display.

This commit is contained in:
2026-09-02 17:53:19 -07:00
parent b00b03c413
commit 5e7e8958e5
+3 -3
View File
@@ -239,7 +239,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
if(passing)
continue;
if(ksym == XK_Escape) {
if(len == 0 && ksym == XK_Escape) {
dspon = !is_screen_on(dpy);
continue;
}
@@ -259,10 +259,10 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
explicit_bzero(&passwd, sizeof(passwd));
len = 0;
break;
/*case XK_Escape:
case XK_Escape:
explicit_bzero(&passwd, sizeof(passwd));
len = 0;
break;*/
break;
case XK_BackSpace:
if (len)
passwd[--len] = '\0';