surface: Don't re-map already-mapped surfaces

If a surface has already been mapped, just return early out of
weston_surface_map(), rather than firing the map signal and rebuilding
the view list.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2023-09-12 14:37:54 +01:00 committed by Marius Vlad
parent 720421c193
commit 5c75ecccfe

View File

@ -2359,6 +2359,9 @@ weston_view_unmap(struct weston_view *view)
WL_EXPORT void
weston_surface_map(struct weston_surface *surface)
{
if (weston_surface_is_mapped(surface))
return;
surface->is_mapped = true;
surface->compositor->view_list_needs_rebuild = true;
weston_signal_emit_mutable(&surface->map_signal, surface);