X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fdecayscreen.c;h=f0d4e95c6b2b4da8ca000f46f115b36628b47c2c;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=42f8149a1d2d02dc79b4c30819886fc17a286af0;hpb=6f5482d73adb0165c0130bb47d852644ab0c4869;p=xscreensaver diff --git a/hacks/decayscreen.c b/hacks/decayscreen.c index 42f8149a..f0d4e95c 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 @@ -36,6 +36,7 @@ */ #include "screenhack.h" +#include struct state { Display *dpy; @@ -140,7 +141,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 +178,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 +200,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 +333,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 +342,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 +373,10 @@ static const char *decayscreen_defaults [] = { "*delay: 10000", "*mode: random", "*duration: 120", +#ifdef HAVE_MOBILE + "*ignoreRotation: True", + "*rotateImages: True", +#endif 0 };