-/* xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1992-2014 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
*/
#include "screenhack.h"
+#include <time.h>
struct state {
Display *dpy;
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;
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);
}
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);
}
unsigned int w, unsigned int h)
{
struct state *st = (struct state *) closure;
+ if (! st->saved) return; /* Image might not be loaded yet */
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;
}
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;
}
"*delay: 10000",
"*mode: random",
"*duration: 120",
+#ifdef HAVE_MOBILE
+ "*ignoreRotation: True",
+ "*rotateImages: True",
+#endif
0
};