]> git.sur5r.net Git - i3/i3lock/commitdiff
Skip keypresses without entering a password, they cause a delay
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 10 Dec 2009 19:24:58 +0000 (20:24 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 10 Dec 2009 19:24:58 +0000 (20:24 +0100)
When suspending your system to RAM, a race-condition can occur which
causes many enter keypresses to be sent. These effectively delay
your login by 3 seconds times 50 times (or so), so we just skip empty
passwords. If your password is empty, you don’t need to lock your
screen anyway.

i3lock.c

index d136ad2e46b05089b9ed47cb628bfae3f58fd6a4..de880c3e51268dea8e071cb659860c10cce81f95 100644 (file)
--- a/i3lock.c
+++ b/i3lock.c
@@ -335,6 +335,9 @@ int main(int argc, char *argv[])
                 switch(ksym) {
                 case XK_Return:
                         passwd[len] = 0;
+                        /* Skip empty passwords */
+                        if (len == 0)
+                                continue;
                         if ((ret = pam_authenticate(handle, 0)) == PAM_SUCCESS)
                                 running = false;
                         else {