[PATCH weston] Restore alpha after fade or zoom effect.

Axel Davy axel.davy at ens.fr
Sat Sep 7 08:10:25 PDT 2013


After these effects, alpha could not have been 1.0, preventing
not redrawing behind opaque windows.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/shell.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index cd94aa5..d7e2d1e 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3485,6 +3485,15 @@ weston_surface_set_initial_position (struct weston_surface *surface,
 }
 
 static void
+surface_restore_alpha(struct weston_surface_animation *animation, void *data)
+{
+	struct weston_surface *surface = data;
+
+	surface->alpha = 1.0;
+	weston_surface_geometry_dirty(surface);
+}
+
+static void
 map(struct desktop_shell *shell, struct weston_surface *surface,
     int32_t width, int32_t height, int32_t sx, int32_t sy)
 {
@@ -3576,10 +3585,12 @@ 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, 300.0, NULL, NULL);
+			weston_fade_run(surface, 0.0, 1.0, 300.0,
+					surface_restore_alpha, surface);
 			break;
 		case ANIMATION_ZOOM:
-			weston_zoom_run(surface, 0.5, 1.0, NULL, NULL);
+			weston_zoom_run(surface, 0.5, 1.0, 
+					surface_restore_alpha, surface);
 			break;
 		default:
 			break;
-- 
1.8.1.2



More information about the wayland-devel mailing list