Commit 9046d242 authored by Kristian Høgsberg's avatar Kristian Høgsberg
Browse files

shell: Orphan child windows when a shell surface is destroyed

We now track the child surfaces of a shell surface and the child surfaces
have a pointer back to their parent.  We need to clean all this up and
NULL out the childrens parent pointers when a shell surface is destroyed.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72931
parent d6d3b377
...@@ -2853,6 +2853,8 @@ static const struct wl_shell_surface_interface shell_surface_implementation = { ...@@ -2853,6 +2853,8 @@ static const struct wl_shell_surface_interface shell_surface_implementation = {
static void static void
destroy_shell_surface(struct shell_surface *shsurf) destroy_shell_surface(struct shell_surface *shsurf)
{ {
struct shell_surface *child, *next;
wl_signal_emit(&shsurf->destroy_signal, shsurf); wl_signal_emit(&shsurf->destroy_signal, shsurf);
if (!wl_list_empty(&shsurf->popup.grab_link)) { if (!wl_list_empty(&shsurf->popup.grab_link)) {
...@@ -2877,6 +2879,10 @@ destroy_shell_surface(struct shell_surface *shsurf) ...@@ -2877,6 +2879,10 @@ destroy_shell_surface(struct shell_surface *shsurf)
weston_view_destroy(shsurf->view); weston_view_destroy(shsurf->view);
wl_list_remove(&shsurf->children_link); wl_list_remove(&shsurf->children_link);
wl_list_for_each_safe(child, next, &shsurf->children_list, children_link) {
wl_list_remove(&child->children_link);
child->parent = NULL;
}
wl_list_remove(&shsurf->link); wl_list_remove(&shsurf->link);
free(shsurf); free(shsurf);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment