diff options
author | Michael Tretter <m.tretter@pengutronix.de> | 2022-10-18 15:24:04 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2022-11-21 13:55:20 +0200 |
commit | e7cf894fa249142271c3e103044d22a9b8e6fa09 (patch) | |
tree | 4c955b6f90bac68252f436ea00eb21c2b8c5a8fd | |
parent | 72a692946755ef50ef9ca64369a833c89c738361 (diff) |
ivi-shell: fix cleanup of desktop surfaces
The ivi-shell keeps track of its surfaces by adding them to the ivi_surface_list
to be able to remove them on shutdown. It also creates an ivi_layout_surface for
a desktop surface, but does not keep track of these surfaces.
During compositor shutdown, libweston prints the following message:
BUG: finalizing a layer with views still on it.
Fix it by adding the created ivi_layout_surface to the ivi_surface_list to
remove the surfaces from the layer during shutdown.
Furthermore, remove the ivi_layout_surface from the desktop surface and free it
when the desktop surface is destroyed.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
(cherry picked from commit 266e2e1d4866ef7c39cff0b77f1e404d0dc96b55)
Resolved small conflict which arose due to commit cbf476f208fbdcefe.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
-rw-r--r-- | ivi-shell/ivi-shell.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index eb6bbbe7..0c80c006 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -507,6 +507,8 @@ desktop_surface_added(struct weston_desktop_surface *surface, ivisurf->layout_surface = layout_surface; ivisurf->surface = weston_surf; + wl_list_insert(&shell->ivi_surface_list, &ivisurf->link); + weston_desktop_surface_set_user_data(surface, ivisurf); } @@ -519,8 +521,14 @@ desktop_surface_removed(struct weston_desktop_surface *surface, assert(ivisurf != NULL); + weston_desktop_surface_set_user_data(surface, NULL); + if (ivisurf->layout_surface) layout_surface_cleanup(ivisurf); + + wl_list_remove(&ivisurf->link); + + free(ivisurf); } static void |