X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fcoral.c;h=7a4e4a97b517bd657aa771c1fb1ac9ae5eb854de;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hp=62df14cda924e0d08202ed9a61b4b98e269d9a7b;hpb=6f5482d73adb0165c0130bb47d852644ab0c4869;p=xscreensaver diff --git a/hacks/coral.c b/hacks/coral.c index 62df14cd..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; @@ -268,6 +269,12 @@ coral_reshape (Display *dpy, Window window, void *closure, 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; } @@ -289,6 +296,9 @@ static const char *coral_defaults[] = { "*seeds: 20", /* too many for 640x480, too few for 1280x1024 */ "*delay: 5", "*delay2: 20000", +#ifdef USE_IPHONE + "*ignoreRotation: True", +#endif 0 };