From c7a38637a47a90230261b80066b160b738824441 Mon Sep 17 00:00:00 2001 From: Nobuhiko Tanibata Date: Tue, 29 Jul 2014 14:30:58 +0900 Subject: weston-ivi-shell: allow to create ivi_controller_surface with ID even if application doesn't map ID to wl_surface yet. Signed-off-by: Nobuhiko Tanibata --- .../ilmControl/src/ilm_control_wayland_platform.c | 5 +++++ weston-ivi-shell/src/ivi-controller.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) 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 037e170..e3f0e56 100644 --- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c @@ -2505,6 +2505,11 @@ ilm_layerRemoveSurface(t_ilm_layer layerId, returnValue = ILM_SUCCESS; } + if ((ctx_surf != NULL) && (ctx_surf->notification != NULL)) { + ctx_surf->notification = NULL; + returnValue = ILM_SUCCESS; + } + release_instance(); return returnValue; } diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c index e9c37a1..434fc4b 100755 --- a/weston-ivi-shell/src/ivi-controller.c +++ b/weston-ivi-shell/src/ivi-controller.c @@ -81,6 +81,7 @@ struct ivicontroller_surface { struct wl_client *client; struct wl_list link; struct ivishell *shell; + int implementation_set; }; struct ivicontroller_layer { @@ -1277,6 +1278,7 @@ controller_surface_create(struct wl_client *client, struct ivicontroller_surface *ctrlsurf = NULL; struct ivi_layout_SurfaceProperties prop; struct ivisurface *ivisurf = NULL; + struct ivicontroller_surface *ctrl_link = NULL; ctrlsurf = calloc(1, sizeof *ctrlsurf); if (!ctrlsurf) { @@ -1303,12 +1305,27 @@ controller_surface_create(struct wl_client *client, return; } + wl_list_for_each(ctrl_link, &shell->list_controller_surface, link) { + if ((ctrl_link->implementation_set == 0) && + (ctrl_link->id_surface == id_surface) && + (ctrl_link->shell == shell) && + (ctrl_link->client != client)) { + ++ivisurf->controller_surface_count; + wl_resource_set_implementation(ctrl_link->resource, + &controller_surface_implementation, + ivisurf, destroy_ivicontroller_surface); + ctrl_link->implementation_set = 1; + } + } + ++ivisurf->controller_surface_count; wl_resource_set_implementation(ctrlsurf->resource, &controller_surface_implementation, ivisurf, destroy_ivicontroller_surface); + ctrlsurf->implementation_set = 1; + memset(&prop, 0, sizeof prop); ivi_layout_getPropertiesOfSurface(ivisurf->layout_surface, &prop); -- cgit v1.2.1