remove fade_time from options struct.

This commit is contained in:
Christopher Jeffrey 2012-09-26 02:37:11 -05:00
parent 93c82a84ef
commit e4e1ed092f
2 changed files with 7 additions and 7 deletions

View File

@ -121,7 +121,6 @@ static options_t options = {
.fade_in_step = 0.028 * OPAQUE,
.fade_out_step = 0.03 * OPAQUE,
.fade_delta = 10,
.fade_time = 0,
.fade_trans = False,
.clear_shadow = False,
.inactive_opacity = 0,
@ -149,6 +148,8 @@ static options_t options = {
* Fades
*/
unsigned long fade_time;
/**
* Get current system clock in milliseconds.
*
@ -171,7 +172,7 @@ get_time_in_milliseconds() {
*/
static int
fade_timeout(void) {
int diff = options.fade_delta - get_time_in_milliseconds() + options.fade_time;
int diff = options.fade_delta - get_time_in_milliseconds() + fade_time;
if (diff < 0)
diff = 0;
@ -1177,10 +1178,10 @@ paint_preprocess(Display *dpy, win *list) {
// Sounds like the timeout in poll() frequently does not work
// accurately, asking it to wait to 20ms, and often it would wait for
// 19ms, so the step value has to be rounded.
unsigned steps = roundl((double) (get_time_in_milliseconds() - options.fade_time) / options.fade_delta);
unsigned steps = roundl((double) (get_time_in_milliseconds() - fade_time) / options.fade_delta);
// Reset options.fade_time
options.fade_time = get_time_in_milliseconds();
// Reset fade_time
fade_time = get_time_in_milliseconds();
for (w = list; w; w = next) {
// In case calling the fade callback function destroys this window
@ -3438,7 +3439,7 @@ main(int argc, char **argv) {
get_cfg(argc, argv);
options.fade_time = get_time_in_milliseconds();
fade_time = get_time_in_milliseconds();
dpy = XOpenDisplay(options.display);
if (!dpy) {

View File

@ -253,7 +253,6 @@ typedef struct _options {
/// How much to fade out in a single fading step.
opacity_t fade_out_step;
unsigned long fade_delta;
unsigned long fade_time;
Bool fade_trans;
Bool clear_shadow;