From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / compass.c
index 5b9ba4990ec51febf325ae04183ec366d5bc14cf..38d890e5120e878848b38ee2eabf1c30b4933543 100644 (file)
@@ -822,7 +822,7 @@ compass_init (Display *dpy, Window window)
   st->delay = get_integer_resource (st->dpy, "delay", "Integer");
   st->dbuf = get_boolean_resource (st->dpy, "doubleBuffer", "Boolean");
 
-# ifdef HAVE_COCOA     /* Don't second-guess Quartz's double-buffering */
+# ifdef HAVE_JWXYZ     /* Don't second-guess Quartz's double-buffering */
   st->dbuf = False;
 # endif
 
@@ -933,6 +933,11 @@ static void
 compass_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  XGetWindowAttributes (st->dpy, st->window, &st->xgwa);
+  st->size2 = MIN(st->xgwa.width, st->xgwa.height);
+  st->x = st->xgwa.width/2;
+  st->y = st->xgwa.height/2;
 }
 
 static Bool