X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fshell.c;h=6a1596eef572ede6c2169d7277b55ccda39783f1;hb=f8457f6d62370f08a4764f44c670bd2368e80415;hp=67f6d8807a97473e5cf5ada1909bf7670e1aba5f;hpb=2d7243208d3e455decd730e7e33ab2452b1a0508;p=src%2Fagl-compositor.git diff --git a/src/shell.c b/src/shell.c index 67f6d88..6a1596e 100644 --- a/src/shell.c +++ b/src/shell.c @@ -344,6 +344,53 @@ static const struct agl_shell_interface agl_shell_implementation = { static void unbind_agl_shell(struct wl_resource *resource) { + struct ivi_compositor *ivi; + struct ivi_output *output; + struct ivi_surface *surf, *surf_tmp; + + ivi = wl_resource_get_user_data(resource); + wl_list_for_each(output, &ivi->outputs, link) { + free(output->background); + output->background = NULL; + + free(output->top); + output->top = NULL; + + free(output->bottom); + output->bottom = NULL; + + free(output->left); + output->left = NULL; + + free(output->right); + output->right = NULL; + + /* reset the active surf if there's one present */ + if (output->active) { + output->active->view->is_mapped = false; + output->active->view->surface->is_mapped = false; + + weston_layer_entry_remove(&output->active->view->layer_link); + output->active = NULL; + } + } + + wl_list_for_each_safe(surf, surf_tmp, &ivi->surfaces, link) { + wl_list_remove(&surf->link); + wl_list_init(&surf->link); + } + + wl_list_for_each_safe(surf, surf_tmp, &ivi->pending_surfaces, link) { + wl_list_remove(&surf->link); + wl_list_init(&surf->link); + } + + wl_list_init(&ivi->surfaces); + wl_list_init(&ivi->pending_surfaces); + + ivi->shell_client.ready = false; + ivi->shell_client.resource = NULL; + ivi->shell_client.client = NULL; } static void