mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-03 03:02:41 +00:00
desktop-shell: Reject invalid focus types in configuration
Just refuse to start up if someone passes an incorrect focus type. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
fca71ff4bb
commit
72a52454ad
|
@ -565,7 +565,7 @@ get_animation_type(char *animation)
|
|||
return ANIMATION_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
static bool
|
||||
shell_configuration(struct desktop_shell *shell)
|
||||
{
|
||||
struct weston_config_section *section;
|
||||
|
@ -592,15 +592,22 @@ shell_configuration(struct desktop_shell *shell)
|
|||
weston_config_section_get_string(section, "close-animation", &s, "fade");
|
||||
shell->win_close_animation_type = get_animation_type(s);
|
||||
free(s);
|
||||
|
||||
weston_config_section_get_string(section,
|
||||
"startup-animation", &s, "fade");
|
||||
shell->startup_animation_type = get_animation_type(s);
|
||||
if (shell->startup_animation_type == ANIMATION_ZOOM) {
|
||||
weston_log("invalid startup animation type %s\n", s);
|
||||
free(s);
|
||||
if (shell->startup_animation_type == ANIMATION_ZOOM)
|
||||
shell->startup_animation_type = ANIMATION_NONE;
|
||||
return false;
|
||||
}
|
||||
free(s);
|
||||
|
||||
weston_config_section_get_string(section, "focus-animation", &s, "none");
|
||||
shell->focus_animation_type = get_animation_type(s);
|
||||
free(s);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -5017,7 +5024,8 @@ wet_shell_init(struct weston_compositor *ec,
|
|||
|
||||
shell->text_backend = text_backend_init(ec);
|
||||
|
||||
shell_configuration(shell);
|
||||
if (!shell_configuration(shell))
|
||||
return -1;
|
||||
|
||||
workspace_create(shell);
|
||||
|
||||
|
|
Loading…
Reference in a new issue