X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fxjack.c;h=55134d915629e269801bd6379fc3c5ae74c77315;hp=b101f8573a45e47a827fd808cff09e106736b968;hb=50be9bb40dc60130c99ffa568e6677779904ff70;hpb=5f1f12f2a37da634000f96d18d59cc73a8814ef7 diff --git a/hacks/xjack.c b/hacks/xjack.c index b101f857..55134d91 100644 --- a/hacks/xjack.c +++ b/hacks/xjack.c @@ -62,6 +62,10 @@ xjack_reshape (Display *dpy, Window window, void *closure, st->rows--; st->columns--; + /* If the window is stupidly small, just truncate. */ + if (st->rows < 4) st->rows = 4; + if (st->columns < 12) st->columns = 12; + if (st->y > st->rows) st->y = st->rows-1; if (st->x > st->columns) st->x = st->columns-2; @@ -116,9 +120,12 @@ xjack_init (Display *dpy, Window window) xjack_reshape (dpy, window, st, st->xgwa.width, st->xgwa.height); - st->left = 0xFF & (random() % ((st->columns / 2)+1)); - st->right = st->left + (0xFF & (random() % (st->columns - st->left - 10) - + 10)); + if (st->columns >= 21) + { + st->left = 0xFF & (random() % ((st->columns / 2)+1)); + st->right = st->left + (0xFF & (random() % (st->columns - st->left - 10) + + 10)); + } st->x = 0; st->y = 0;