+ XSetForeground (si->dpy, gc2, pw->passwd_background);
+
+ /* the "user name" text field
+ */
+ y1 = y2;
+ XSetForeground (si->dpy, gc1, pw->passwd_foreground);
+ XSetFont (si->dpy, gc1, pw->passwd_font->fid);
+ y1 += (spacing + tb_height);
+ x2 += (pw->shadow_width * 4);
+
+ pw->passwd_field_width = x3 - x2 - pw->internal_border;
+ pw->passwd_field_height = (pw->passwd_font->ascent +
+ pw->passwd_font->descent +
+ pw->shadow_width);
+
+ XFillRectangle (si->dpy, si->passwd_dialog, gc2,
+ x2 - pw->shadow_width,
+ y1 - (pw->passwd_font->ascent + pw->passwd_font->descent),
+ pw->passwd_field_width, pw->passwd_field_height);
+ XDrawString (si->dpy, si->passwd_dialog, gc1, x2, y1,
+ pw->user_string, strlen(pw->user_string));
+
+ /* the "password" text field
+ */
+ y1 += (spacing + tb_height);
+
+ pw->passwd_field_x = x2 - pw->shadow_width;
+ pw->passwd_field_y = y1 - (pw->passwd_font->ascent +
+ pw->passwd_font->descent);
+
+ /* The shadow around the text fields
+ */
+ y1 = y2;
+ y1 += (spacing + (pw->shadow_width * 3));
+ x1 = x2 - (pw->shadow_width * 2);
+ x2 = pw->passwd_field_width + (pw->shadow_width * 2);
+ y2 = pw->passwd_field_height + (pw->shadow_width * 2);
+
+ draw_shaded_rectangle (si->dpy, si->passwd_dialog,
+ x1, y1, x2, y2,
+ pw->shadow_width,
+ pw->shadow_bottom, pw->shadow_top);
+
+ y1 += (spacing + pw->passwd_font->ascent + pw->passwd_font->descent +
+ (pw->shadow_width * 4));
+ draw_shaded_rectangle (si->dpy, si->passwd_dialog,
+ x1, y1, x2, y2,
+ pw->shadow_width,
+ pw->shadow_bottom, pw->shadow_top);
+
+
+ /* The date, below the text fields
+ */
+ {
+ char buf[100];
+ time_t now = time ((time_t *) 0);
+ struct tm *tm = localtime (&now);
+ memset (buf, 0, sizeof(buf));
+ strftime (buf, sizeof(buf)-1, pw->date_label, tm);
+
+ XSetFont (si->dpy, gc1, pw->date_font->fid);
+ y1 += pw->shadow_width;
+ y1 += (spacing + tb_height);
+ y1 += spacing/2;
+ sw = string_width (pw->date_font, buf);
+ x2 = x1 + x2 - sw;
+ XDrawString (si->dpy, si->passwd_dialog, gc1, x2, y1, buf, strlen(buf));
+ }
+
+
+ /* the logo
+ */
+ XSetForeground (si->dpy, gc1, pw->logo_foreground);
+ XSetForeground (si->dpy, gc2, pw->logo_background);
+
+ x1 = pw->shadow_width * 3;
+ y1 = pw->shadow_width * 3;
+ x2 = pw->logo_width - (pw->shadow_width * 6);
+ y2 = pw->logo_height - (pw->shadow_width * 6);
+
+ XFillRectangle (si->dpy, si->passwd_dialog, gc2, x1, y1, x2, y2);
+ skull (si->dpy, si->passwd_dialog, gc1, gc2,
+ x1 + pw->shadow_width, y1 + pw->shadow_width,
+ x2 - (pw->shadow_width * 2), y2 - (pw->shadow_width * 2));
+
+ /* The thermometer
+ */
+ pw->thermo_field_x = pw->logo_width + pw->shadow_width;
+ pw->thermo_field_y = pw->shadow_width * 3;
+ pw->thermo_field_height = pw->height - (pw->shadow_width * 6);
+
+ /* Solid border inside the logo box. */
+ XSetForeground (si->dpy, gc1, pw->foreground);
+ XDrawRectangle (si->dpy, si->passwd_dialog, gc1, x1, y1, x2-1, y2-1);
+
+ /* The shadow around the logo
+ */
+ draw_shaded_rectangle (si->dpy, si->passwd_dialog,
+ pw->shadow_width * 2,
+ pw->shadow_width * 2,
+ pw->logo_width - (pw->shadow_width * 4),
+ pw->logo_height - (pw->shadow_width * 4),
+ pw->shadow_width,
+ pw->shadow_bottom, pw->shadow_top);
+
+ /* The shadow around the thermometer
+ */
+ draw_shaded_rectangle (si->dpy, si->passwd_dialog,
+ pw->logo_width,
+ pw->shadow_width * 2,
+ pw->thermo_width + (pw->shadow_width * 2),
+ pw->height - (pw->shadow_width * 4),
+ pw->shadow_width,
+ pw->shadow_bottom, pw->shadow_top);
+
+ /* Solid border inside the thermometer. */
+ XSetForeground (si->dpy, gc1, pw->foreground);
+ XDrawRectangle (si->dpy, si->passwd_dialog, gc1,
+ pw->logo_width + pw->shadow_width,
+ pw->shadow_width * 3,
+ pw->thermo_width - 1,
+ pw->height - (pw->shadow_width * 6) - 1);
+
+ /* The shadow around the whole window
+ */
+ draw_shaded_rectangle (si->dpy, si->passwd_dialog,
+ 0, 0, pw->width, pw->height, pw->shadow_width,
+ pw->shadow_top, pw->shadow_bottom);
+
+ XFreeGC (si->dpy, gc1);
+ XFreeGC (si->dpy, gc2);
+
+ update_passwd_window (si, pw->passwd_string, pw->ratio);
+}
+
+
+static void
+update_passwd_window (saver_info *si, const char *printed_passwd, float ratio)
+{
+ passwd_dialog_data *pw = si->pw_data;
+ XGCValues gcv;
+ GC gc1, gc2;
+ int x, y;
+ XRectangle rects[1];
+
+ pw->ratio = ratio;
+ gcv.foreground = pw->passwd_foreground;
+ gcv.font = pw->passwd_font->fid;
+ gc1 = XCreateGC (si->dpy, si->passwd_dialog, GCForeground|GCFont, &gcv);
+ gcv.foreground = pw->passwd_background;
+ gc2 = XCreateGC (si->dpy, si->passwd_dialog, GCForeground, &gcv);
+
+ if (printed_passwd)