http://ftp.x.org/contrib/applications/xscreensaver-2.23.tar.gz
[xscreensaver] / driver / lock.c
index a79d21354297c55e4fb884544e5d9138fa495763..c6a715a5df43aea807911704c3ea68d84d368a22 100644 (file)
@@ -1,5 +1,5 @@
 /* lock.c --- handling the password dialog for locking-mode.
- * xscreensaver, Copyright (c) 1993-1997 Jamie Zawinski <jwz@netscape.com>
+ * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski <jwz@netscape.com>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -22,6 +22,7 @@
 #include <X11/StringDefs.h>
 #include <X11/Intrinsic.h>
 #include "xscreensaver.h"
+#include "resources.h"
 
 #ifndef VMS
 # include <pwd.h>
@@ -445,6 +446,17 @@ passwd_idle_timer (XtPointer closure, XtIntervalId *id)
 
       x = (w / 2);
 
+#ifdef __sgi   /* Kludge -- SGI's Motif hacks place buttons differently. */
+      {
+       static int sgi_mode = -1;
+       if (sgi_mode == -1)
+         sgi_mode = get_boolean_resource("sgiMode", "sgiMode") ? 1 : 0;
+
+       if (sgi_mode)
+         x = d;
+      }
+#endif /* __sgi */
+
       x -= d/2;
       y += d/2;
 
@@ -592,14 +604,14 @@ pop_passwd_dialog (saver_info *si)
     XMapRaised (dpy, XtWindow (passwd_dialog));
 #endif
 
+  monitor_power_on (si);
 #ifdef HAVE_ATHENA
   pop_up_athena_dialog_box (parent, passwd_text, passwd_dialog,
                            passwd_form, 2);
 #else
   pop_up_dialog_box (passwd_dialog, passwd_form,
-#ifdef DEBUG
+                    /* for debugging -- don't ask */
                     (si->prefs.debug_p ? 69 : 0) +
-#endif
                     2);
   XtManageChild (passwd_form);
 #endif
@@ -619,14 +631,12 @@ pop_passwd_dialog (saver_info *si)
     roger(roger_label, 0, 0);
 #endif /* HAVE_ATHENA */
 
-#ifdef DEBUG
   if (!si->prefs.debug_p)
-#endif
-  XGrabServer (dpy);                           /* ############ DANGER! */
+    XGrabServer (dpy);                         /* ############ DANGER! */
 
   /* this call to ungrab used to be in main_loop() - see comment in
       xscreensaver.c around line 857. */
-  ungrab_keyboard_and_mouse (si->dpy);
+  ungrab_keyboard_and_mouse (si);
 
   while (passwd_state == pw_read)
     {