X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fboxfit.c;h=1fa42ca0e75d454d55e23bde6faf0965ec511683;hb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;hp=41878c0b5f52f52746b02d904975b19fb1ff6959;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;p=xscreensaver diff --git a/hacks/boxfit.c b/hacks/boxfit.c index 41878c0b..1fa42ca0 100644 --- a/hacks/boxfit.c +++ b/hacks/boxfit.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2005, 2006 Jamie Zawinski +/* xscreensaver, Copyright (c) 2005-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -121,8 +121,10 @@ reset_boxes (state *st) else { st->ncolors = get_integer_resource (st->dpy, "colors", "Colors"); /* re-get */ + if (st->ncolors < 1) st->ncolors = 1; make_smooth_colormap (st->dpy, st->xgwa.visual, st->xgwa.colormap, st->colors, &st->ncolors, True, 0, False); + if (st->ncolors < 1) abort(); XClearWindow (st->dpy, st->window); } } @@ -518,6 +520,7 @@ boxfit_free (Display *dpy, Window window, void *closure) static const char *boxfit_defaults [] = { ".background: black", ".foreground: #444444", + "*fpsSolid: true", "*delay: 20000", "*mode: random", "*colors: 64", @@ -551,4 +554,4 @@ static XrmOptionDescRec boxfit_options [] = { }; -XSCREENSAVER_MODULE ("Boxfit", boxfit) +XSCREENSAVER_MODULE ("BoxFit", boxfit)