mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-03 03:12:18 +00:00
desktop-shell: Regularise focus_animation_type checks
Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
72a52454ad
commit
f17581fdd2
|
@ -605,6 +605,12 @@ shell_configuration(struct desktop_shell *shell)
|
||||||
|
|
||||||
weston_config_section_get_string(section, "focus-animation", &s, "none");
|
weston_config_section_get_string(section, "focus-animation", &s, "none");
|
||||||
shell->focus_animation_type = get_animation_type(s);
|
shell->focus_animation_type = get_animation_type(s);
|
||||||
|
if (shell->focus_animation_type != ANIMATION_NONE &&
|
||||||
|
shell->focus_animation_type != ANIMATION_DIM_LAYER) {
|
||||||
|
weston_log("invalid focus animation type %s\n", s);
|
||||||
|
free(s);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
free(s);
|
free(s);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -936,10 +942,12 @@ workspace_create(struct desktop_shell *shell)
|
||||||
wl_list_init(&ws->seat_destroyed_listener.link);
|
wl_list_init(&ws->seat_destroyed_listener.link);
|
||||||
ws->seat_destroyed_listener.notify = seat_destroyed;
|
ws->seat_destroyed_listener.notify = seat_destroyed;
|
||||||
|
|
||||||
if (shell->focus_animation_type == ANIMATION_DIM_LAYER) {
|
if (shell->focus_animation_type != ANIMATION_NONE) {
|
||||||
struct weston_output *output =
|
struct weston_output *output =
|
||||||
weston_shell_utils_get_default_output(shell->compositor);
|
weston_shell_utils_get_default_output(shell->compositor);
|
||||||
|
|
||||||
|
assert(shell->focus_animation_type == ANIMATION_DIM_LAYER);
|
||||||
|
|
||||||
ws->fsurf_front = create_focus_surface(shell->compositor, output);
|
ws->fsurf_front = create_focus_surface(shell->compositor, output);
|
||||||
assert(ws->fsurf_front);
|
assert(ws->fsurf_front);
|
||||||
ws->fsurf_back = create_focus_surface(shell->compositor, output);
|
ws->fsurf_back = create_focus_surface(shell->compositor, output);
|
||||||
|
@ -3728,6 +3736,7 @@ activate(struct desktop_shell *shell, struct weston_view *view,
|
||||||
shell_surface_update_layer(shsurf);
|
shell_surface_update_layer(shsurf);
|
||||||
|
|
||||||
if (shell->focus_animation_type != ANIMATION_NONE) {
|
if (shell->focus_animation_type != ANIMATION_NONE) {
|
||||||
|
assert(shell->focus_animation_type == ANIMATION_DIM_LAYER);
|
||||||
ws = get_current_workspace(shell);
|
ws = get_current_workspace(shell);
|
||||||
animate_focus_change(shell, ws, get_default_view(old_es), get_default_view(es));
|
animate_focus_change(shell, ws, get_default_view(old_es), get_default_view(es));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue