commit 342a0cadef55fc80b985e46b7927cdf753b79dcf
parent 12e4afe93ceb18e99a0836580b481454ba0b179d
Author: regexghost <dev@regexghost.com>
Date: Fri, 7 Aug 2026 18:16:53 +0100
added ctrl-backspace to delete all entered text
Diffstat:
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,7 +1,7 @@
*.o
-slock
-config.h
-patches/
+/slock
+/config.h
+/patches/
*.diff
*.rej
*.orig
diff --git a/slock.c b/slock.c
@@ -177,6 +177,12 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
IsPFKey(ksym) ||
IsPrivateKeypadKey(ksym))
continue;
+ if ((&ev.xkey)->state & ControlMask) {
+ if (ksym == XK_BackSpace) {
+ explicit_bzero(&passwd, sizeof(passwd));
+ len = 0;
+ }
+ }
switch (ksym) {
case XK_Return:
passwd[len] = '\0';
@@ -212,6 +218,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
}
break;
}
+
color = len ? INPUT : ((failure || failonclear) ? FAILED : INIT);
if (running && oldc != color) {
for (screen = 0; screen < nscreens; screen++) {