X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Ftessellimage.c;h=d361eb3fb4f4944d1c0dea114b7d3a6f16ae7cb1;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=5fd681e1a35f10a2c8cffe4c7627eacc9335927e;hpb=dba664f31aa87285db4d76cf8c5e66335299703a;p=xscreensaver diff --git a/hacks/tessellimage.c b/hacks/tessellimage.c index 5fd681e1..d361eb3f 100644 --- a/hacks/tessellimage.c +++ b/hacks/tessellimage.c @@ -15,7 +15,7 @@ #undef DO_VORONOI -#ifndef HAVE_COCOA +#ifndef HAVE_JWXYZ # define XK_MISCELLANY # include #endif @@ -67,13 +67,11 @@ static void * tessellimage_init (Display *dpy, Window window) { struct state *st = (struct state *) calloc (1, sizeof(*st)); - Colormap cmap; st->dpy = dpy; st->window = window; XGetWindowAttributes (st->dpy, st->window, &st->xgwa); - cmap = st->xgwa.colormap; st->delay = get_integer_resource (st->dpy, "delay", "Integer"); if (st->delay < 1) st->delay = 1; @@ -543,6 +541,9 @@ tessellate (struct state *st) st->pgc = XCreateGC(st->dpy, st->image, GCFunction, &gcv); } + if (! st->nthreshes) return; + + /* If duration2 has expired, switch to the next threshold. */ if (! st->button_down_p) @@ -856,6 +857,14 @@ tessellimage_draw (Display *dpy, Window window, void *closure) 0, 0, st->delta->width, st->delta->height, (st->xgwa.width - st->delta->width) / 2, (st->xgwa.height - st->delta->height) / 2); + else if (!st->nthreshes) + XCopyArea (st->dpy, + st->image, + st->window, st->wgc, + 0, 0, st->xgwa.width, st->xgwa.height, + 0, + 0); + DONE: return st->delay; @@ -883,30 +892,10 @@ tessellimage_event (Display *dpy, Window window, void *closure, XEvent *event) st->button_down_p = False; return True; } - else if (event->xany.type == KeyPress) + else if (screenhack_event_helper (dpy, window, event)) { - KeySym keysym = 0; - char c = 0; - if (event->xany.type == KeyPress || event->xany.type == KeyRelease) - XLookupString (&event->xkey, &c, 1, &keysym, 0); - - switch (keysym) { - case XK_Left: - case XK_Right: - case XK_Down: - case XK_Up: - st->start_time = 0; /* load next image */ - return True; - } - - switch (c) { - case '\r': - case '\n': - case '+': - case '=': - st->start_time = 0; - return True; - } + st->start_time = 0; /* load next image */ + return True; } return False; @@ -941,8 +930,9 @@ static const char *tessellimage_defaults [] = { "*outline: True", "*fillScreen: True", "*cache: True", -#ifdef USE_IPHONE +#ifdef HAVE_MOBILE "*ignoreRotation: True", + "*rotateImages: True", #endif 0 };