summaryrefslogtreecommitdiffstats
path: root/driver/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/lock.c')
-rw-r--r--driver/lock.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/driver/lock.c b/driver/lock.c
index 7696f30..d36481e 100644
--- a/driver/lock.c
+++ b/driver/lock.c
@@ -1400,6 +1400,8 @@ destroy_passwd_window (saver_info *si)
memset (pw, 0, sizeof(*pw));
free (pw);
si->pw_data = 0;
+
+ si->unlock_dismiss_time = time((time_t *) 0);
}
@@ -2216,6 +2218,7 @@ Bool
unlock_p (saver_info *si)
{
saver_preferences *p = &si->prefs;
+ time_t now = time ((time_t *) 0);
if (!si->unlock_cb)
{
@@ -2225,6 +2228,18 @@ unlock_p (saver_info *si)
raise_window (si, True, True, True);
+ /* If your cat is sitting on the return key, don't thrash the window.
+ Only one failed/cancelled unlock per 2 seconds.
+ */
+ if (si->unlock_dismiss_time >= now - 1)
+ {
+ if (p->verbose_p)
+ fprintf (stderr, "%s: unlock: thrashing: RET held down?\n", blurb());
+ XSync (si->dpy, False);
+# undef sleep
+ sleep (2); /* This is less than ideal, but fine */
+ }
+
xss_authenticate(si, p->verbose_p);
return (si->unlock_state == ul_success);