From 59b6e6973e2fa68f7ee194f9e28b09f32f1d0c61 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 18 Aug 2023 13:23:05 -0500 Subject: [PATCH] desktop-shell: assert if the shell startup animation type is unsupported We've already validated this, so if we can't get here with an invalid type. Just assert() instead. This lets us remove the very strange tear down of curtains that presumably couldn't have been created in the first place?? Signed-off-by: Derek Foreman --- desktop-shell/shell.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index f9697a9a5..0d5b2f3f3 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -3989,19 +3989,12 @@ static void do_shell_fade_startup(void *data) { struct desktop_shell *shell = data; - struct shell_output *shell_output; - if (shell->startup_animation_type == ANIMATION_FADE) { + assert(shell->startup_animation_type == ANIMATION_FADE || + shell->startup_animation_type == ANIMATION_NONE); + + if (shell->startup_animation_type == ANIMATION_FADE) shell_fade(shell, FADE_IN); - } else { - weston_log("desktop shell: " - "unexpected fade-in animation type %d\n", - shell->startup_animation_type); - wl_list_for_each(shell_output, &shell->output_list, link) { - weston_shell_utils_curtain_destroy(shell_output->fade.curtain); - shell_output->fade.curtain = NULL; - } - } } static void