From: Marius Vlad Date: Wed, 21 Oct 2020 21:07:53 +0000 (+0300) Subject: shell: Destroy weston_transmitter_surface as well X-Git-Tag: 10.91.0~7 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=681f5df234921e989606eefc6e293f37883bb22e;p=src%2Fagl-compositor.git shell: Destroy weston_transmitter_surface as well Instruct waltham-transmitter-plugin that it can destroy its own surface representation when the weston_surface is also destroyed. Bug-AGL: SPEC-3601, SPEC-3611 Signed-off-by: Marius Vlad Change-Id: Ie0e5409b21c043b8c98bebb4d77808227ee38aca --- diff --git a/src/desktop.c b/src/desktop.c index 4caba48..ad1ce44 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -192,6 +192,10 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata) output->active = NULL; } + if (surface->role == IVI_SURFACE_ROLE_REMOTE && + output->type == OUTPUT_REMOTE) + ivi_destroy_waltham_destroy(surface); + /* check if there's a last 'remote' surface and insert a black * surface view if there's no background set for that output */ diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h index 3dd0c20..189cd8c 100644 --- a/src/ivi-compositor.h +++ b/src/ivi-compositor.h @@ -415,4 +415,6 @@ ivi_seat_reset_caps_sent(struct ivi_compositor *ivi); void agl_shell_desktop_advertise_application_id(struct ivi_compositor *ivi, struct ivi_surface *surface); +void +ivi_destroy_waltham_destroy(struct ivi_surface *surface); #endif diff --git a/src/shell.c b/src/shell.c index 0422583..fb15dfc 100644 --- a/src/shell.c +++ b/src/shell.c @@ -107,6 +107,20 @@ ivi_set_desktop_surface_fullscreen(struct ivi_surface *surface) agl_shell_desktop_advertise_application_id(ivi, surface); } +void +ivi_destroy_waltham_destroy(struct ivi_surface *surface) +{ + struct ivi_compositor *ivi = surface->ivi; + const struct weston_transmitter_api *api = + ivi->waltham_transmitter_api; + + if (!api) + return; + + if (surface->waltham_surface.transmitter_surface) + api->surface_destroy(surface->waltham_surface.transmitter_surface); +} + static void ivi_output_notify_waltham_plugin(struct ivi_surface *surface) {