From 9c86c0f21b9d34c0ae491327482415a946102c4f Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Mon, 26 Dec 2011 21:08:05 -0500 Subject: fix fade-in speed when opacity raises Fixes: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648158 Signed-off-by: Alan Coopersmith --- xcompmgr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xcompmgr.c b/xcompmgr.c index 3968def..4e40958 100644 --- a/xcompmgr.c +++ b/xcompmgr.c @@ -2337,8 +2337,17 @@ main (int argc, char **argv) if (w) { if (fadeTrans) - set_fade (dpy, w, w->opacity*1.0/OPAQUE, get_opacity_percent (dpy, w, 1.0), - fade_out_step, NULL, False, True, False); + { + double start, finish, step; + start = w->opacity*1.0/OPAQUE; + finish = get_opacity_percent (dpy, w, 1.0); + if(start > finish) + step = fade_in_step; + else + step = fade_out_step; + set_fade (dpy, w, start, finish, step, + NULL, False, True, False); + } else { w->opacity = get_opacity_prop(dpy, w, OPAQUE); -- cgit v1.2.3