spring: Tweak the window fade-in spring to not overshoot
The fade animation overshoots and rings for a bit dipping back into slightly transparent. Bug 61675 was right. https://bugs.freedesktop.org/show_bug.cgi?id=61675
This commit is contained in:
+6
-3
@@ -265,16 +265,19 @@ weston_fade_run(struct weston_surface *surface,
|
|||||||
fade_frame, done, data);
|
fade_frame, done, data);
|
||||||
|
|
||||||
weston_spring_init(&fade->spring, k, start, end);
|
weston_spring_init(&fade->spring, k, start, end);
|
||||||
|
|
||||||
|
fade->spring.friction = 1400;
|
||||||
|
fade->spring.previous = -(end - start) * 0.03;
|
||||||
|
|
||||||
surface->alpha = start;
|
surface->alpha = start;
|
||||||
|
|
||||||
return fade;
|
return fade;
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
weston_fade_update(struct weston_surface_animation *fade,
|
weston_fade_update(struct weston_surface_animation *fade, float target)
|
||||||
float start, float end, float k)
|
|
||||||
{
|
{
|
||||||
weston_spring_init(&fade->spring, k, start, end);
|
fade->spring.target = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
+1
-2
@@ -1142,8 +1142,7 @@ weston_fade_run(struct weston_surface *surface,
|
|||||||
float start, float end, float k,
|
float start, float end, float k,
|
||||||
weston_surface_animation_done_func_t done, void *data);
|
weston_surface_animation_done_func_t done, void *data);
|
||||||
void
|
void
|
||||||
weston_fade_update(struct weston_surface_animation *fade,
|
weston_fade_update(struct weston_surface_animation *fade, float target);
|
||||||
float start, float end, float k);
|
|
||||||
|
|
||||||
struct weston_surface_animation *
|
struct weston_surface_animation *
|
||||||
weston_slide_run(struct weston_surface *surface, float start, float stop,
|
weston_slide_run(struct weston_surface *surface, float start, float stop,
|
||||||
|
|||||||
+3
-4
@@ -3135,12 +3135,11 @@ shell_fade(struct desktop_shell *shell, enum fade_type type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shell->fade.animation)
|
if (shell->fade.animation)
|
||||||
weston_fade_update(shell->fade.animation,
|
weston_fade_update(shell->fade.animation, tint);
|
||||||
shell->fade.surface->alpha, tint, 30.0);
|
|
||||||
else
|
else
|
||||||
shell->fade.animation =
|
shell->fade.animation =
|
||||||
weston_fade_run(shell->fade.surface,
|
weston_fade_run(shell->fade.surface,
|
||||||
1.0 - tint, tint, 30.0,
|
1.0 - tint, tint, 300.0,
|
||||||
shell_fade_done, shell);
|
shell_fade_done, shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3457,7 +3456,7 @@ map(struct desktop_shell *shell, struct weston_surface *surface,
|
|||||||
{
|
{
|
||||||
switch (shell->win_animation_type) {
|
switch (shell->win_animation_type) {
|
||||||
case ANIMATION_FADE:
|
case ANIMATION_FADE:
|
||||||
weston_fade_run(surface, 0.0, 1.0, 200.0, NULL, NULL);
|
weston_fade_run(surface, 0.0, 1.0, 300.0, NULL, NULL);
|
||||||
break;
|
break;
|
||||||
case ANIMATION_ZOOM:
|
case ANIMATION_ZOOM:
|
||||||
weston_zoom_run(surface, 0.8, 1.0, NULL, NULL);
|
weston_zoom_run(surface, 0.8, 1.0, NULL, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user