view: Mark view list as dirty when destroying mapped view

If a view is in the view list when it's being destroyed, we need to
rebuild the view list. However, doing so is currently very hairy as
views are created and destroyed at will ... including when rebuilding
the view list.

In preparation for creating and destroying subsurface views at the time
of the action rather than later at repaint time, pull out the immediate
view-list rebuild and simply mark the view list as needing a full
rebuild.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2023-06-27 07:44:23 +01:00
parent 314f2ba0c3
commit f39b1e9fbd
1 changed files with 2 additions and 0 deletions

View File

@ -2227,6 +2227,8 @@ weston_view_destroy(struct weston_view *view)
wl_list_for_each_safe(pnode, pntmp, &view->paint_node_list, view_link)
weston_paint_node_destroy(pnode);
if (!wl_list_empty(&view->link))
view->surface->compositor->view_list_needs_rebuild = true;
wl_list_remove(&view->link);
weston_layer_entry_remove(&view->layer_link);