[PATCH v2] Restoring alpha after the shell effects.

Kristian Høgsberg hoegsberg at gmail.com
Thu Sep 12 15:29:02 PDT 2013


On Thu, Sep 12, 2013 at 11:32:54AM +0200, Axel Davy wrote:
> You are right, but if we use the slide effect, the target value has
> no meaning for alpha.
> The only time we use the fade effect with a target alpha value of 0
> is the shell_fade effect with the FADE_IN parameter: at the end the
> surface is destroyed anyway.
> 
> I think however the first patch was better, but I should add too to
> set surface->alpha to 1.0 for the shell_fade effect and the FADE_OUT
> parameter.
> 
> Kristian, what do you like better?

If we have to do it right, I think the fade animation should install
its own done handler local to animation.c, which calls the user
provided done function and then sets the alpha to animation->target.

Alternatively, we may just be able to tweak the cut-off value in
fade_frame().  The problem is that the animation stop before we get
above that threshold.  right now it rounds to 1 when alpha is above
0.999, but we never get there.  We could lower that a bit, say 0.995,
and/or tweak the threshold in weston_spring_done to be a little lower.

Kristian

> Axel Davy
> 
> 
> Le 12/09/2013 10:27, Giulio Camuffo a écrit :
> >Shouldn't this set the alpha to the target alpha instead of 1?
> >What if i fade from 1 to 0, this will set it back to 1 when it's
> >done.
> >
> >
> >2013/9/12 Axel Davy <axel.davy at ens.fr <mailto:axel.davy at ens.fr>>
> >
> >    After the fade or zoom effects, alpha could not have been 1.0,
> >    preventing
> >    not redrawing behind opaque windows.
> >
> >    Signed-off-by: Axel Davy <axel.davy at ens.fr <mailto:axel.davy at ens.fr>>
> >    ---
> >     src/animation.c | 1 +
> >     1 file changed, 1 insertion(+)
> >
> >    diff --git a/src/animation.c b/src/animation.c
> >    index 0b2fa95..9603115 100644
> >    --- a/src/animation.c
> >    +++ b/src/animation.c
> >    @@ -134,6 +134,7 @@ weston_surface_animation_destroy(struct
> >    weston_surface_animation *animation)
> >            wl_list_remove(&animation->animation.link);
> >            wl_list_remove(&animation->listener.link);
> >            wl_list_remove(&animation->transform.link);
> >    +       animation->surface->alpha = 1.0;
> >    weston_surface_geometry_dirty(animation->surface);
> >            if (animation->done)
> >                    animation->done(animation, animation->data);
> >    --
> >    1.8.1.2
> >
> >    _______________________________________________
> >    wayland-devel mailing list
> >    wayland-devel at lists.freedesktop.org
> >    <mailto:wayland-devel at lists.freedesktop.org>
> >    http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> >
> >
> 

> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list