http://slackware.bholcomb.com/slackware/slackware-11.0/source/xap/xscreensaver/xscree...
[xscreensaver] / driver / windows.c
index e9891af746c849426db40907da6ea2a8abb03cbb..ff7d6ddc998375d1d9b2596aecb9d84951f18f1c 100644 (file)
@@ -1,5 +1,5 @@
 /* windows.c --- turning the screen black; dealing with visuals, virtual roots.
- * xscreensaver, Copyright (c) 1991-2004 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2006 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
@@ -30,7 +30,7 @@
 #endif /* HAVE_UNAME */
 
 #include <stdio.h>
-#include <X11/Xproto.h>                /* for CARD32 */
+/* #include <X11/Xproto.h>     / * for CARD32 */
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>         /* for XSetClassHint() */
 #include <X11/Xatom.h>
 #include <time.h>
 #include <sys/time.h>
 
+/* You might think that to store an array of 32-bit quantities onto a
+   server-side property, you would pass an array of 32-bit data quantities
+   into XChangeProperty().  You would be wrong.  You have to use an array
+   of longs, even if long is 64 bits (using 32 of each 64.)
+ */
+typedef long PROP32;
+
 #ifdef HAVE_MIT_SAVER_EXTENSION
 # include <X11/extensions/scrnsaver.h>
 #endif /* HAVE_MIT_SAVER_EXTENSION */
@@ -966,16 +973,16 @@ store_saver_id (saver_screen_info *ssi)
 void
 store_saver_status (saver_info *si)
 {
-  CARD32 *status;
+  PROP32 *status;
   int size = si->nscreens + 2;
   int i;
 
-  status = (CARD32 *) calloc (size, sizeof(CARD32));
+  status = (PROP32 *) calloc (size, sizeof(PROP32));
 
-  status[0] = (CARD32) (si->screen_blanked_p
+  status[0] = (PROP32) (si->screen_blanked_p
                         ? (si->locked_p ? XA_LOCK : XA_BLANK)
                         : 0);
-  status[1] = (CARD32) si->blank_time;
+  status[1] = (PROP32) si->blank_time;
 
   for (i = 0; i < si->nscreens; i++)
     {
@@ -1412,7 +1419,12 @@ initialize_screensaver_window_1 (saver_screen_info *ssi)
   attrs.backing_pixel = ssi->black_pixel;
   attrs.border_pixel = ssi->black_pixel;
 
-  if (p->debug_p && !p->quad_p) width = width / 2;
+  if (p->debug_p
+# ifdef QUAD_MODE
+      && !p->quad_p
+# endif
+      )
+    width = width / 2;
 
   if (!p->verbose_p || printed_visual_info)
     ;
@@ -1670,7 +1682,12 @@ resize_screensaver_window (saver_info *si)
       changes.height = height;
       changes.border_width = 0;
 
-      if (p->debug_p && !p->quad_p) changes.width = changes.width / 2;
+      if (p->debug_p
+# ifdef QUAD_MODE
+          && !p->quad_p
+# endif
+          ) 
+        changes.width = changes.width / 2;
 
       if (p->verbose_p)
         fprintf (stderr,