summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-02-05 18:37:05 +0200
committerMarius Vlad <marius.vlad@collabora.com>2020-02-06 13:40:06 +0200
commitf8457f6d62370f08a4764f44c670bd2368e80415 (patch)
tree4f417c4d5ae62f71a39e26fc367e9b88d503f2d4
parent08ea4a2fec76b4bdd90b6072ff1002d0829afbed (diff)
shell: Allow the client shell to unbind/rebind to agl-shell interface
Restarting the client shell requires the compositor to restart, this removes the ivi_surfaces and from the ivi_output and normal surfaces, pending surfaces and re-initilizes the lists for handling them. Bug-AGL: SPEC-3158 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic352ad5bc1e60b3df5b76a0239895aaf3aa81c56
-rw-r--r--src/shell.c47
1 files changed, 47 insertions, 0 deletions
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