X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fdecayscreen.c;h=e2ce9a0963d347c00ea0a7851d47b185599d8403;hb=refs%2Fremotes%2Fgithub%2Fmaster2;hp=42f8149a1d2d02dc79b4c30819886fc17a286af0;hpb=6f5482d73adb0165c0130bb47d852644ab0c4869;p=xscreensaver diff --git a/hacks/decayscreen.c b/hacks/decayscreen.c index 42f8149a..e2ce9a09 100644 --- a/hacks/decayscreen.c +++ b/hacks/decayscreen.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-2014 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -140,7 +140,7 @@ decayscreen_init (Display *dpy, Window window) gcflags |= GCSubwindowMode; st->gc = XCreateGC (st->dpy, st->window, gcflags, &gcv); - st->start_time = time ((time_t) 0); + st->start_time = time ((time_t *) 0); decayscreen_load_image (st); return st; @@ -177,7 +177,7 @@ decayscreen_draw (Display *dpy, Window window, void *closure) 0, 0, 0, 0, 0); if (! st->img_loader) { /* just finished */ - st->start_time = time ((time_t) 0); + st->start_time = time ((time_t *) 0); if (st->random_p) st->mode = random() % (FUZZ+1); @@ -199,7 +199,7 @@ decayscreen_draw (Display *dpy, Window window, void *closure) } if (!st->img_loader && - st->start_time + st->duration < time ((time_t) 0)) { + st->start_time + st->duration < time ((time_t *) 0)) { decayscreen_load_image (st); } @@ -332,8 +332,8 @@ decayscreen_reshape (Display *dpy, Window window, void *closure, XClearWindow (st->dpy, st->window); XCopyArea (st->dpy, st->saved, st->window, st->gc, 0, 0, st->saved_w, st->saved_h, - (w - st->saved_w) / 2, - (h - st->saved_h) / 2); + ((int)w - st->saved_w) / 2, + ((int)h - st->saved_h) / 2); st->sizex = w; st->sizey = h; } @@ -341,6 +341,12 @@ decayscreen_reshape (Display *dpy, Window window, void *closure, static Bool decayscreen_event (Display *dpy, Window window, void *closure, XEvent *event) { + struct state *st = (struct state *) closure; + if (screenhack_event_helper (dpy, window, event)) + { + st->start_time = 0; + return True; + } return False; } @@ -366,6 +372,10 @@ static const char *decayscreen_defaults [] = { "*delay: 10000", "*mode: random", "*duration: 120", +#ifdef USE_IPHONE + "*ignoreRotation: True", + "*rotateImages: True", +#endif 0 };