X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fcoral.c;h=7a4e4a97b517bd657aa771c1fb1ac9ae5eb854de;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hp=9603455e42cef7866fb7f853beba7e5babf663eb;hpb=07faf451b99879183ed7e909e43a0e065be1ee7f;p=xscreensaver diff --git a/hacks/coral.c b/hacks/coral.c index 9603455e..7a4e4a97 100644 --- a/hacks/coral.c +++ b/hacks/coral.c @@ -67,7 +67,7 @@ init_coral(struct state *st) if(!st->board) exit(1); cmap = xgwa.colormap; if( st->ncolors ) { - free_colors(st->dpy, cmap, st->colors, st->ncolors); + free_colors(xgwa.screen, cmap, st->colors, st->ncolors); st->ncolors = 0; } gcv.foreground = st->default_fg_pixel = get_pixel_resource(st->dpy, cmap, "foreground", "Foreground"); @@ -75,7 +75,8 @@ init_coral(struct state *st) gcv.foreground = get_pixel_resource (st->dpy, cmap, "background", "Background"); st->erase_gc = XCreateGC (st->dpy, st->window, GCForeground, &gcv); st->ncolors = NCOLORSMAX; - make_uniform_colormap(st->dpy, xgwa.visual, cmap, st->colors, &st->ncolors, True, &writeable, False); + make_uniform_colormap(xgwa.screen, xgwa.visual, cmap, + st->colors, &st->ncolors, True, &writeable, False); if (st->ncolors <= 0) { st->ncolors = 2; st->colors[0].red = st->colors[0].green = st->colors[0].blue = 0; @@ -261,11 +262,19 @@ static void coral_reshape (Display *dpy, Window window, void *closure, unsigned int w, unsigned int h) { + struct state *st = (struct state *) closure; + init_coral(st); } static Bool coral_event (Display *dpy, Window window, void *closure, XEvent *event) { + struct state *st = (struct state *) closure; + if (screenhack_event_helper (dpy, window, event)) + { + st->reset = 1; + return True; + } return False; } @@ -282,10 +291,14 @@ coral_free (Display *dpy, Window window, void *closure) static const char *coral_defaults[] = { ".background: black", ".foreground: white", + "*fpsSolid: true", "*density: 25", "*seeds: 20", /* too many for 640x480, too few for 1280x1024 */ "*delay: 5", "*delay2: 20000", +#ifdef USE_IPHONE + "*ignoreRotation: True", +#endif 0 };