From 071440ef54444c3be2aa72a402563a97cc350e3b Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 19 Dec 2023 16:24:05 +0200 Subject: [PATCH] shell: Provide a better explanation for terminating the connection And make sure we clear off the remaing client resources when doing an unbind. It seems we would hit it when checking set_background/ready/set_panel requests, resulting in a protocol violation and finally terminating the connection. Bug-AGL: SPEC-4977 Signed-off-by: Marius Vlad Change-Id: Ie5ed881511ec2ac4501d2a5cac349abc7f83c1fe --- src/shell.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shell.c b/src/shell.c index 5157830..c089bec 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1108,8 +1108,8 @@ shell_ready(struct wl_client *client, struct wl_resource *shell_res) ivi->shell_client.status == BOUND_FAILED) { wl_resource_post_error(shell_res, WL_DISPLAY_ERROR_INVALID_OBJECT, - "agl_shell has already been bound. " - "Check out bound_fail event"); + "agl_shell (ready quest) has already " + "been bound. Check out bound_fail event"); return; } @@ -1165,8 +1165,8 @@ shell_set_background(struct wl_client *client, ivi->shell_client.resource_ext == shell_res) { wl_resource_post_error(shell_res, WL_DISPLAY_ERROR_INVALID_OBJECT, - "agl_shell has already been bound. " - "Check out bound_fail event"); + "agl_shell (set_background) has already " + "been bound. Check out bound_fail event"); return; } @@ -1230,7 +1230,7 @@ shell_set_panel(struct wl_client *client, ivi->shell_client.resource_ext == shell_res) { wl_resource_post_error(shell_res, WL_DISPLAY_ERROR_INVALID_OBJECT, - "agl_shell has already been bound. " + "agl_shell (set_panel) has already been bound. " "Check out bound_fail event"); return; } @@ -1860,6 +1860,7 @@ unbind_agl_shell(struct wl_resource *resource) ivi->shell_client.ready = false; ivi->shell_client.resource = NULL; + ivi->shell_client.resource_ext = NULL; ivi->shell_client.client = NULL; } @@ -1869,6 +1870,7 @@ unbind_agl_shell_ext(struct wl_resource *resource) struct ivi_compositor *ivi = wl_resource_get_user_data(resource); ivi->shell_client_ext.resource = NULL; + ivi->shell_client.resource_ext = NULL; } static void -- 2.16.6