X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fslidescreen.c;h=190f50711f8f8a205932ebb306dba3955a987fad;hb=39809ded547bdbb08207d3e514950425215b4410;hp=4ba8b7ff42a229bca254da293ca1c0c2df202709;hpb=d5186197bc394e10a4402f7f6d23fbb14103bc50;p=xscreensaver diff --git a/hacks/slidescreen.c b/hacks/slidescreen.c index 4ba8b7ff..190f5071 100644 --- a/hacks/slidescreen.c +++ b/hacks/slidescreen.c @@ -108,7 +108,7 @@ slidescreen_init (Display *dpy, Window window) else st->bg = 1; -#ifndef HAVE_COCOA +#ifndef HAVE_JWXYZ if (!fg_ok || bg_ok) { int i; @@ -167,7 +167,7 @@ slidescreen_init (Display *dpy, Window window) } XFree(all); } -#endif /* !HAVE_COCOA */ +#endif /* !HAVE_JWXYZ */ } gcv.foreground = st->fg; @@ -198,6 +198,16 @@ draw_grid (struct state *st) 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; + } + 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; @@ -475,7 +485,7 @@ static const char *slidescreen_defaults [] = { "*delay: 50000", "*delay2: 1000000", "*duration: 120", -#ifdef USE_IPHONE +#ifdef HAVE_MOBILE "*ignoreRotation: True", "*rotateImages: True", #endif