From http://www.jwz.org/xscreensaver/xscreensaver-5.30.tar.gz
[xscreensaver] / driver / lock.c
index 296bcd02dc0f52c607588d9ce1b6ebb9af1e4514..7c92be60d6375bda6dbb69c47191d1ab833919ef 100644 (file)
@@ -1,5 +1,5 @@
 /* lock.c --- handling the password dialog for locking-mode.
- * xscreensaver, Copyright (c) 1993-2011 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1993-2014 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -487,6 +487,11 @@ make_passwd_window (saver_info *si,
    * room for the dialog to grow without going off the edge of the screen. */
   max_string_width_px *= 0.75;
 
+  if (!info_msg && senescent_p())
+    info_msg = ("\n"
+                "This version of XScreenSaver\n"
+                "is very old! Please upgrade!\n");
+
   pw->info_label = mlstring_new(info_msg ? info_msg : pw->body_label,
                                pw->label_font, max_string_width_px);
 
@@ -1417,6 +1422,8 @@ destroy_passwd_window (saver_info *si)
 }
 
 
+#if defined(HAVE_XF86MISCSETGRABKEYSSTATE) || defined(HAVE_XF86VMODE)
+
 static Bool error_handler_hit_p = False;
 
 static int
@@ -1426,6 +1433,8 @@ ignore_all_errors_ehandler (Display *dpy, XErrorEvent *error)
   return 0;
 }
 
+#endif /* HAVE_XF86MISCSETGRABKEYSSTATE || HAVE_XF86VMODE */
+
 
 #ifdef HAVE_XHPDISABLERESET
 /* This function enables and disables the C-Sh-Reset hot-key, which
@@ -1879,6 +1888,7 @@ passwd_event_loop (saver_info *si)
   } event;
 
   passwd_animate_timer ((XtPointer) si, 0);
+  reset_watchdog_timer (si, False);    /* Disable watchdog while dialog up */
 
   while (si->unlock_state == ul_read)
     {
@@ -1971,6 +1981,8 @@ passwd_event_loop (saver_info *si)
          ;
       }
     }
+
+  reset_watchdog_timer (si, True);     /* Re-enable watchdog */
 }
 
 
@@ -2181,6 +2193,11 @@ auth_finished_cb (saver_info *si)
           s = buf;
         }
       si->unlock_failures = 0;
+
+      /* ignore failures if they all were too recent */
+      if (time((time_t *) 0) - si->unlock_failure_time 
+          < si->prefs.auth_warning_slack)
+       goto END;
     }
   else                                         /* good, with no failures, */
     goto END;                                  /* or timeout, or cancel. */