X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fmunch.c;h=6116a595d633c868835c04906f1ead39f8874272;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hp=2636375edf4bcab802c8ecafebdf9399884febfe;hpb=7b34ef992563d7bcbb64cc5597dc45fa24470b05;p=xscreensaver diff --git a/hacks/munch.c b/hacks/munch.c index 2636375e..6116a595 100644 --- a/hacks/munch.c +++ b/hacks/munch.c @@ -1,6 +1,6 @@ /* Munching Squares and Mismunch * - * Portions copyright 1992-2008 Jamie Zawinski + * Portions copyright 1992-2014 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this * software and its documentation for any purpose is hereby @@ -417,6 +417,20 @@ munch_reshape (Display *dpy, Window window, void *closure, static Bool munch_event (Display *dpy, Window window, void *closure, XEvent *event) { + struct state *st = (struct state *) closure; + if (screenhack_event_helper (dpy, window, event)) + { + int i; + st->window_height--; + munch_reshape(dpy, window, closure, st->window_width, st->window_height); + st->mismunch = random() & 1; + for (i = 0; i < st->simul; i++) { + free (st->munchers[i]); + st->munchers[i] = make_muncher(st); + } + XClearWindow(dpy, window); + return True; + } return False; } @@ -437,6 +451,9 @@ static const char *munch_defaults [] = { "*simul: 5", "*clear: 65", "*xor: True", +#ifdef USE_IPHONE + "*ignoreRotation: True", +#endif 0 };