From 5c75ecccfeda36ee8b40d6d29cddc801cf2cfc9f Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 12 Sep 2023 14:37:54 +0100 Subject: [PATCH] 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 --- libweston/compositor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libweston/compositor.c b/libweston/compositor.c index 82e3a43f..3bc6000f 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -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);