[PATCH 2/2] animation: fade: don't start with complete transparency

Rune K. Svendsen runesvend at gmail.com
Sat Feb 23 21:43:34 PST 2013


From: "Rune K. Svendsen" <runesvend at gmail.com>

I was doing some research on why I thought enabling the zoom/fade
animations added latency (a gap between releasing the launcher
button and the window appearing), and I found out that it's because,
for the first few frames, the alpha value is set to zero due to the
spring value being zero for the first few frames. This effectively
causes the first few frames to be invisible, and so, delays the
animation by about 20-30 ms. Making sure the alpha value has a
minimum value to begin with, makes opening new windows feel more
responsive when the animation is enabled.
---
 src/shell.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shell.c b/src/shell.c
index 6573038..7ebc34f 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3123,7 +3123,7 @@ map(struct desktop_shell *shell, struct weston_surface *surface,
 	{
 		switch (shell->win_animation_type) {
 		case ANIMATION_FADE:
-			weston_fade_run(surface, 0.0, 1.0, 200.0, NULL, NULL);
+			weston_fade_run(surface, 0.3, 1.0, 200.0, NULL, NULL);
 			break;
 		case ANIMATION_ZOOM:
 			weston_zoom_run(surface, 0.8, 1.0, NULL, NULL);
-- 
1.7.10.4



More information about the wayland-devel mailing list