diff options
author | Derek Foreman <derek.foreman@collabora.com> | 2024-04-03 10:21:24 -0500 |
---|---|---|
committer | Derek Foreman <derek.foreman@collabora.com> | 2024-04-23 07:28:22 -0500 |
commit | 25d8eb6b5ab24672486a00b1568f8789b589e080 (patch) | |
tree | bb8920760ce52a4033af359c6166cc65d195d1ad | |
parent | abe3e20e1f82ea12f59822eaba20ceb232c3b200 (diff) |
libweston: Destroy paint nodes when releasing a plane
Previously we assigned any paint node to the primary_plane of the output
it was on and marked it dirty.
This doesn't make sense if we're releasing the primary_plane.
Let's just delete the paint nodes and force a view list rebuild, which
will recreate them appropriately.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
-rw-r--r-- | libweston/compositor.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libweston/compositor.c b/libweston/compositor.c index 0da37366..a73b91f7 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -5959,18 +5959,20 @@ weston_plane_release(struct weston_plane *plane) { struct weston_output *output; + /* We might be releasing a primary plane, so we can't just casually + * reassign paint nodes to another plane here - delete them and + * force a rebuild. + */ wl_list_for_each(output, &plane->compositor->output_list, link) { - struct weston_paint_node *node; + struct weston_paint_node *node, *pntmp; - wl_list_for_each(node, &output->paint_node_z_order_list, - z_order_link) { + wl_list_for_each_safe(node, pntmp, + &output->paint_node_list, output_link) { if (node->plane != plane) continue; - node->plane = NULL; - node->plane_next = &output->primary_plane; - node->status |= PAINT_NODE_PLANE_DIRTY | - PAINT_NODE_VISIBILITY_DIRTY; + output->compositor->view_list_needs_rebuild = true; + weston_paint_node_destroy(node); } } |