From 1da1d860fea2f68699de0390f21ea6dd5c146041 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 20 Jun 2023 11:44:23 +0100 Subject: [PATCH] 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 --- desktop-shell/shell.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 8cf66e9b..29973c80 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -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