desktop-shell: Use weston_view_to_layer() for lock surface

Use the new helper instead of open-coding part of it. This removes a
comment about not marking a surface as mapped until it has a buffer: the
surface->width == 0 check already guarantees that we have a buffer.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2023-06-20 11:44:23 +01:00
parent 5c9231b116
commit 1da1d860fe

View file

@ -3082,18 +3082,14 @@ lock_surface_committed(struct weston_surface *surface,
if (surface->width == 0)
return;
if (weston_surface_is_mapped(surface))
return;
weston_surface_map(surface);
weston_view_move_to_layer(view, &shell->lock_layer.view_list);
weston_shell_utils_center_on_output(view,
weston_shell_utils_get_default_output(shell->compositor));
if (!weston_surface_is_mapped(surface)) {
/* XXX: don't map without a buffer */
weston_surface_map(surface);
weston_layer_entry_insert(&shell->lock_layer.view_list,
&view->layer_link);
view->is_mapped = true;
weston_view_update_transform(view); /* XXX: geometry_dirty */
shell_fade(shell, FADE_IN);
}
shell_fade(shell, FADE_IN);
}
static void