summaryrefslogtreecommitdiffstats
path: root/compton.c
diff options
context:
space:
mode:
authorChristopher Jeffrey <chjjeffrey@gmail.com>2012-09-26 02:37:11 -0500
committerChristopher Jeffrey <chjjeffrey@gmail.com>2012-09-26 02:38:51 -0500
commitfdf1593a098b02bd79ced0ae05749268dd486220 (patch)
tree80f44726fe36042fe69cf55cdd7da191e4495728 /compton.c
parenta0439e57dd9d1e6fb8fa1174a5ed19da6377638f (diff)
downloadtdebase-fdf1593a098b02bd79ced0ae05749268dd486220.tar.gz
tdebase-fdf1593a098b02bd79ced0ae05749268dd486220.zip
remove fade_time from options struct.
Diffstat (limited to 'compton.c')
-rw-r--r--compton.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/compton.c b/compton.c
index fad26365e..8c493689d 100644
--- a/compton.c
+++ b/compton.c
@@ -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) {