summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>2014-04-07 16:11:43 +0200
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2014-04-07 16:11:43 +0200
commit0016a4948cdb0ce2f043454bcee17353803e9282 (patch)
treecd30019d31934bdf77b7abc6dabce4aeece398d1
parente228d2eb6a4e660b4baa01d37887fcde8d20f3a6 (diff)
downloadwayland-ivi-extension-0016a4948cdb0ce2f043454bcee17353803e9282.tar.gz
remove ivi_controller_surface on content_removed event1.2.0_rc41.2.0-rc4
in ILM API, surfaceDestroy(x) will remove all references to this surface from scene. To achieve same behavior, ivi controllers must release their corresponding ivi_controller_surfaces on content_removed event. Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
-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