compositor: Add paint_node_changes for paint node removal

When moving the views between two outputs, the view's paint node is
removed from an output's z order list, but no paint_node_changes are set.

The drm-backend uses paint_node_changes to determine if it can reuse state,
so could leave a stale image behind on a plane until something else
triggered new state generation.

Make z_order_link removal dirty the paint node changes to prevent stale
state reuse.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2026-01-06 11:51:33 -06:00
parent 8ba7fb8195
commit 2543ec3f54

View file

@ -441,6 +441,16 @@ weston_paint_node_remove_z_order_link(struct weston_paint_node *pnode)
if (!wl_list_empty(&pnode->z_order_link))
paint_node_damage_below(pnode, &pnode->visible);
/* Once we unlink this paint node, it will no longer be seen by
* the paint node update functions that accumulate paint node
* changes for the output. Those changes might be used by the
* backend to decide whether it needs to regenerate plane state
* or not.
*
* Flag changes as dirty so the backends know something happened.
*/
pnode->output->paint_node_changes |= WESTON_PAINT_NODE_ALL_DIRTY;
/* Clear damage related variables to as-new state */
pnode->plane = NULL;
pixman_region32_clear(&pnode->visible_previous);