-/* xscreensaver, Copyright (c) 1992-2014 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1992-2018 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
XGetWindowAttributes (st->dpy, st->window, &xgwa);
st->img_loader = load_image_async_simple (0, xgwa.screen, st->window,
st->window, 0, 0);
- st->start_time = time ((time_t) 0);
+ st->start_time = time ((time_t *) 0);
st->max_width = xgwa.width;
st->max_height = xgwa.height;
st->grid_size = get_integer_resource (st->dpy, "gridSize", "Integer");
st->pix_inc = get_integer_resource (st->dpy, "pixelIncrement", "Integer");
+ if (xgwa.width > 2560) st->grid_size *= 2; /* Retina displays */
+
+
/* Don't let the grid be smaller than 5x5 */
while (st->grid_size > xgwa.width / 5)
st->grid_size /= 2;
else
st->bg = 1;
-#ifndef HAVE_COCOA
+#ifndef HAVE_JWXYZ
if (!fg_ok || bg_ok)
{
int i;
}
XFree(all);
}
-#endif /* !HAVE_COCOA */
+#endif /* !HAVE_JWXYZ */
}
gcv.foreground = st->fg;
st->bitmap_w = xgwa.width;
st->bitmap_h = xgwa.height;
+ if (xgwa.width < 50 || xgwa.height < 50) /* tiny window */
+ {
+ int s = (xgwa.width < xgwa.height ? xgwa.width : xgwa.height);
+ border = 1;
+ st->grid_size = s / 2;
+ if (st->grid_size < 16) st->grid_size = 16;
+ if (st->bitmap_w < st->grid_size*2) st->bitmap_w = st->grid_size*2;
+ if (st->bitmap_h < st->grid_size*2) st->bitmap_h = st->grid_size*2;
+ }
+
+ if (xgwa.width > 2560) border *= 2; /* Retina displays */
+
st->grid_w = st->bitmap_w / st->grid_size;
st->grid_h = st->bitmap_h / st->grid_size;
st->hole_x = random () % st->grid_w;
{
st->img_loader = load_image_async_simple (st->img_loader, 0, 0, 0, 0, 0);
if (! st->img_loader) { /* just finished */
- st->start_time = time ((time_t) 0);
+ st->start_time = time ((time_t *) 0);
draw_grid (st);
}
return st->delay;
}
if (!st->img_loader &&
- st->start_time + st->duration < time ((time_t) 0)) {
+ st->start_time + st->duration < time ((time_t *) 0)) {
XWindowAttributes xgwa;
XGetWindowAttributes(st->dpy, st->window, &xgwa);
st->img_loader = load_image_async_simple (0, xgwa.screen, st->window,
st->window, 0, 0);
- st->start_time = time ((time_t) 0);
+ st->start_time = time ((time_t *) 0);
st->draw_initted = 0;
return st->delay;
}
XGetWindowAttributes (st->dpy, st->window, &xgwa);
st->img_loader = load_image_async_simple (0, xgwa.screen, st->window,
st->window, 0, 0);
- st->start_time = time ((time_t) 0);
+ st->start_time = time ((time_t *) 0);
}
}
"*delay: 50000",
"*delay2: 1000000",
"*duration: 120",
-#ifdef USE_IPHONE
+#ifdef HAVE_MOBILE
"*ignoreRotation: True",
"*rotateImages: True",
#endif