projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.33.tar.gz
[xscreensaver]
/
hacks
/
fireworkx.c
diff --git
a/hacks/fireworkx.c
b/hacks/fireworkx.c
index 11bc5e5b478c3755443ed12437dcfe22da1ef17f..db1c8d8168a658096cea796f3b7b18603f59de57 100644
(file)
--- a/
hacks/fireworkx.c
+++ b/
hacks/fireworkx.c
@@
-100,6
+100,9
@@
struct state
int depth;
int bigendian;
int ncolors;
int depth;
int bigendian;
int ncolors;
+ Bool button_down_p;
+ int deferred;
+
};
/*
};
/*
@@
-777,11
+780,19
@@
fireworkx_draw (Display *dpy, Window win, void *closure)
{
if (!explode(st, fs))
{
{
if (!explode(st, fs))
{
- recycle(st, fs, rnd(st->width), rnd(st->height));
+ if (st->button_down_p)
+ st->deferred++;
+ else
+ recycle(st, fs, rnd(st->width), rnd(st->height));
}
}
}
}
}
}
+ while (!st->button_down_p && st->deferred) {
+ st->deferred--;
+ recycle_oldest(st, rnd(st->width), rnd(st->height));
+ }
+
glow_blur(st);
if (st->flash_on)
glow_blur(st);
if (st->flash_on)
@@
-810,8
+821,15
@@
fireworkx_event (Display *dpy, Window window, void *closure, XEvent *event)
if (event->type == ButtonPress)
{
recycle_oldest(st, event->xbutton.x, event->xbutton.y);
if (event->type == ButtonPress)
{
recycle_oldest(st, event->xbutton.x, event->xbutton.y);
+ st->button_down_p = True;
+ return True;
+ }
+ else if (event->type == ButtonRelease)
+ {
+ st->button_down_p = False;
return True;
}
return True;
}
+
return False;
}
return False;
}