summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>2014-08-10 21:57:22 +0900
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>2014-08-21 10:08:14 +0900
commitbf765341d315f172934d91371b6d83483b894f17 (patch)
treea40b3e0bd3d9ad6f329b05617fa9585300ea6ee8
parentc7a38637a47a90230261b80066b160b738824441 (diff)
downloadwayland-ivi-extension-bf765341d315f172934d91371b6d83483b894f17.tar.gz
ilmControl: allow to set callback of surfaceAddNotification even if application doen't map ID to wl_surface.
When application map ID to wl_surface by ivi_application.createSurface, content_state is notified with content_available. Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
-rw-r--r--ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c27
1 files changed, 16 insertions, 11 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 e3f0e56..11789e0 100644
--- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
@@ -168,6 +168,7 @@ static inline void unlock_context(struct ilm_control_context *ctx)
static int init_control(void);
static struct ilm_control_context* sync_and_acquire_instance(void);
+static struct surface_context* get_surface_context(struct wayland_context *, uint32_t);
static void release_instance(void);
@@ -804,12 +805,14 @@ controller_listener_surface(void *data,
{
struct wayland_context *ctx = data;
struct surface_context *ctx_surf = NULL;
- int32_t is_inside = 0;
-
- is_inside = wayland_controller_is_inside_surface_list(
- &ctx->list_surface, id_surface);
- if (is_inside != 0) {
+ ctx_surf = get_surface_context(ctx, id_surface);
+ if (ctx_surf != NULL) {
+ if (ctx_surf-> notification != NULL) {
+ ctx_surf->notification(ctx_surf->id_surface,
+ &ctx_surf->prop,
+ ILM_NOTIFICATION_ALL);
+ }
fprintf(stderr, "invalid id_surface in controller_listener_surface\n");
return;
}
@@ -2400,8 +2403,15 @@ ilm_surfaceAddNotification(t_ilm_surface surface,
ctx_surf = (struct surface_context*)get_surface_context(
&ctx->wl, (uint32_t)surface);
if (ctx_surf == NULL) {
+ controller_listener_surface(ctx, ctx->wl.controller, (uint32_t)surface);
+ ctx_surf = (struct surface_context*)get_surface_context(
+ &ctx->wl, (uint32_t)surface);
+ }
+
+ if (ctx_surf == NULL) {
returnValue = ILM_ERROR_INVALID_ARGUMENTS;
- } else {
+ }
+ else {
ctx_surf->notification = callback;
returnValue = ILM_SUCCESS;
@@ -2505,11 +2515,6 @@ 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;
}