summaryrefslogtreecommitdiff
path: root/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c')
-rw-r--r--ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
index 780faea..d4cd6d4 100644
--- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
@@ -1104,9 +1104,26 @@ controller_surface_listener_content(void *data,
struct ivi_controller_surface *controller,
int32_t content_state)
{
- (void)data;
- (void)controller;
- (void)content_state;
+ // if client surface (=content) was removed with ilm_surfaceDestroy()
+ // the expected behavior within ILM API mandates a full removal
+ // of the surface from the scene. We must remove the controller
+ // from scene, too.
+ if (IVI_CONTROLLER_SURFACE_CONTENT_STATE_CONTENT_REMOVED == content_state)
+ {
+ struct wayland_context *ctx = data;
+ struct surface_context *ctx_surf = NULL;
+
+ ctx_surf = get_surface_context_by_controller(ctx, controller);
+ if (ctx_surf == NULL) {
+ fprintf(stderr, "Invalid controller_surface in %s\n", __FUNCTION__);
+ return;
+ }
+
+ ivi_controller_surface_destroy(controller, IVI_CONTROLLER_OBJECT_TYPE_SURFACE);
+
+ wl_list_remove(&ctx_surf->link);
+ free(ctx_surf);
+ }
}
static void