compositor: Move surface mappedness to weston_surface regen

And with it, invalidate the cached string upon calling the signal
handlers.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2025-12-06 09:28:11 +02:00
parent 5346432aba
commit 0926bd1025

View file

@ -973,6 +973,9 @@ weston_surface_debug_string_regenerate(FILE *fp, void *data)
fprintf(fp, "role %s, PID %d, surface ID %u, %s",
surface->role_name, pid, surface_id, desc);
if (!weston_surface_is_mapped(surface))
fprintf(fp, "\t[surface is not mapped!]\n");
}
WL_EXPORT struct weston_surface *
@ -2619,6 +2622,8 @@ static void weston_surface_start_mapping(struct weston_surface *surface)
surface->is_mapping = true;
surface->is_mapped = true;
surface->compositor->view_list_needs_rebuild = true;
weston_cached_str_invalidate(&surface->scene_graph_record);
wl_signal_emit_mutable(&surface->map_signal, surface);
}
@ -2642,6 +2647,8 @@ weston_surface_unmap(struct weston_surface *surface)
wl_list_for_each(view, &surface->views, surface_link)
weston_view_unmap(view);
surface->output = NULL;
weston_cached_str_invalidate(&surface->scene_graph_record);
wl_signal_emit_mutable(&surface->unmap_signal, surface);
}
@ -9569,8 +9576,6 @@ debug_scene_view_print(FILE *fp, struct weston_view *view, int view_idx)
if (!weston_view_is_mapped(view))
fprintf(fp, "\t[view is not mapped!]\n");
if (!weston_surface_is_mapped(view->surface))
fprintf(fp, "\t[surface is not mapped!]\n");
if (wl_list_empty(&view->layer_link.link)) {
if (!get_view_layer(view))
fprintf(fp, "\t[view is not part of any layer]\n");