From 4b7fb568351e0e1bede5254b3e00a455ffbc1bf5 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 27 Jun 2023 06:44:47 +0100 Subject: [PATCH] view: Destroy subsurface views with their parents When we're destroying a parent view, also destroy any of its children which are subsurface views that we've created automatically in the core. Signed-off-by: Daniel Stone --- libweston/compositor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 38cfa98d..ffff6eb0 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -1778,7 +1778,11 @@ transform_parent_handle_parent_destroy(struct wl_listener *listener, geometry.parent_destroy_listener); weston_view_set_transform_parent(view, NULL); - view->parent_view = NULL; + + /* Destroy any child views which were automatically created for a + * subsurface when the parent view is destroyed. */ + if (view->parent_view) + weston_view_destroy(view); } WL_EXPORT void