if (ticked_p && st->cache[st->thresh])
{
- XCopyArea (st->dpy,
- st->cache[st->thresh],
- st->output, st->pgc,
- 0, 0, st->delta->width, st->delta->height,
- 0, 0);
+ if (st->output)
+ XCopyArea (st->dpy,
+ st->cache[st->thresh],
+ st->output, st->pgc,
+ 0, 0, st->delta->width, st->delta->height,
+ 0, 0);
}
else if (ticked_p)
{
fprintf (stderr, "%s: out of memory\n", progname);
abort();
}
- XCopyArea (st->dpy,
- st->output,
- st->cache[st->thresh],
- st->pgc,
- 0, 0, st->delta->width, st->delta->height,
- 0, 0);
+ if (st->output)
+ XCopyArea (st->dpy,
+ st->output,
+ st->cache[st->thresh],
+ st->pgc,
+ 0, 0, st->delta->width, st->delta->height,
+ 0, 0);
}
}
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;
{
struct state *st = (struct state *) closure;
flush_cache (st);
- XFreeGC (dpy, st->wgc);
- XFreeGC (dpy, st->pgc);
+ if (st->wgc) XFreeGC (dpy, st->wgc);
+ if (st->pgc) XFreeGC (dpy, st->pgc);
if (st->image) XFreePixmap (dpy, st->image);
if (st->output) XFreePixmap (dpy, st->output);
if (st->delta) XDestroyImage (st->delta);
"*cache: True",
#ifdef USE_IPHONE
"*ignoreRotation: True",
+ "*rotateImages: True",
#endif
0
};