X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Flock.c;h=169880b1b6a993f7ead31e3206406a7150241d00;hp=8d61981f9da4e1829e08032de66dea8a377b419a;hb=3f438031d610c7e15fd33876a879b97e290e05fb;hpb=447db08c956099b3b183886729108bf5b364c4b8 diff --git a/driver/lock.c b/driver/lock.c index 8d61981f..169880b1 100644 --- a/driver/lock.c +++ b/driver/lock.c @@ -97,6 +97,9 @@ struct passwd_dialog_data { Dimension height; Dimension border_width; + Bool show_stars_p; /* "I regret that I have but one asterisk for my country." + -- Nathan Hale, 1776. */ + char *heading_label; char *body_label; char *user_label; @@ -191,6 +194,8 @@ make_passwd_window (saver_info *si) pw->ratio = 1.0; + pw->show_stars_p = get_boolean_resource("passwd.asterisks", "Boolean"); + pw->heading_label = get_string_resource ("passwd.heading.label", "Dialog.Label.Label"); pw->body_label = get_string_resource ("passwd.body.label", @@ -1384,6 +1389,10 @@ handle_passwd_key (saver_info *si, XKeyEvent *event) s[1] = 0; + /* Add 10% to the time remaining every time a key is pressed. */ + pw->ratio += 0.1; + if (pw->ratio > 1) pw->ratio = 1; + switch (*s) { case '\010': case '\177': /* Backspace */ @@ -1426,12 +1435,19 @@ handle_passwd_key (saver_info *si, XKeyEvent *event) break; } - i = strlen(typed_passwd); - stars = (char *) malloc(i+1); - memset (stars, '*', i); - stars[i] = 0; - update_passwd_window (si, stars, pw->ratio); - free (stars); + if (pw->show_stars_p) + { + i = strlen(typed_passwd); + stars = (char *) malloc(i+1); + memset (stars, '*', i); + stars[i] = 0; + update_passwd_window (si, stars, pw->ratio); + free (stars); + } + else + { + update_passwd_window (si, "", pw->ratio); + } }