From 43b59786e644486de0c7e2e4b385adb9f7c8d937 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 20 Jul 2023 14:52:08 -0500 Subject: [PATCH] paint_node: Fix paint_node_damage_below This list walk is broken, the intent was to walk the tail of the list starting from the currently held node - but that is not what happens. Instead, walk the list backwards and stop a the held node. Also, paint_node_damage_below() is used when moving paint nodes between planes, and in these cases we definitely don't want to limit damage to the current plane. Signed-off-by: Derek Foreman --- libweston/compositor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 35d2a57c2..c5bc19053 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -157,11 +157,12 @@ paint_node_damage_below(struct weston_paint_node *pnode) if (!pnode->plane) return; - wl_list_for_each(lower_node, &pnode->z_order_link, - z_order_link) { + wl_list_for_each_reverse(lower_node, + &pnode->output->paint_node_z_order_list, + z_order_link) { - if (lower_node->plane != pnode->plane) - continue; + if (lower_node == pnode) + break; pixman_region32_union(&lower_node->damage, &lower_node->damage, &pnode->visible);