diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp> | 2013-12-19 16:47:10 +0900 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp> | 2014-01-08 15:32:51 +0900 |
commit | 83a98a7bab03e9b356a2a556457dfdc0bf9691cd (patch) | |
tree | 793c5e83022078b3d8ab347e140f0310b339078f | |
parent | de19bed9bae50ba2513d956e2ffa35ca7e3ff4c5 (diff) | |
download | wayland-ivi-extension-83a98a7bab03e9b356a2a556457dfdc0bf9691cd.tar.gz |
ivi-layermanagement-api: Add support of receiving notification of property change
Add wl_display_dispatch after ivi_controller_layer/surface_add_listener to receive
events of property change of layer/surface.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
-rw-r--r-- | ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c | 66 |
1 files changed, 35 insertions, 31 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 8fa7d7c..bba8e2f 100644 --- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c @@ -1215,42 +1215,40 @@ controller_listener_layer(void *data, struct layer_context *ctx_layer = NULL; int32_t is_inside = 0; - do { - /* Return failed, if layerid is already inside list_layer */ - is_inside = wayland_controller_is_inside_layer_list( - &ctx->list_layer, id_layer); - if (0 != is_inside) { - break; - } - - ctx_layer = calloc(1, sizeof *ctx_layer); - if (ctx_layer == NULL) { - fprintf(stderr, "Failed to allocate memory for layer_context\n"); - break; - } + /* Return failed, if layerid is already inside list_layer */ + is_inside = wayland_controller_is_inside_layer_list( + &ctx->list_layer, id_layer); + if (0 != is_inside) { + return; + } - ctx_layer->controller = ivi_controller_layer_create( - controller, id_layer, 10, 10); - if (ctx_layer->controller == NULL) { - fprintf(stderr, "Failed to create layer\n"); - free(ctx_layer); - break; - } - ctx_layer->id_layer = id_layer; + ctx_layer = calloc(1, sizeof *ctx_layer); + if (ctx_layer == NULL) { + fprintf(stderr, "Failed to allocate memory for layer_context\n"); + return; + } - wl_list_init(&ctx_layer->link); - wl_list_insert(&ctx->list_layer, &ctx_layer->link); - wl_list_init(&ctx_layer->order.link); - wl_list_init(&ctx_layer->order.list_surface); + ctx_layer->controller = ivi_controller_layer_create( + controller, id_layer, 10, 10); + if (ctx_layer->controller == NULL) { + fprintf(stderr, "Failed to create layer\n"); + free(ctx_layer); + ctx_layer = NULL; + return; + } + ctx_layer->id_layer = id_layer; - wl_display_flush(ctx->display); - wl_display_dispatch(ctx->display); - wl_display_roundtrip(ctx->display); + wl_list_init(&ctx_layer->link); + wl_list_insert(&ctx->list_layer, &ctx_layer->link); + wl_list_init(&ctx_layer->order.link); + wl_list_init(&ctx_layer->order.list_surface); - ivi_controller_layer_add_listener(ctx_layer->controller, - &controller_layer_listener, ctx); + ivi_controller_layer_add_listener(ctx_layer->controller, + &controller_layer_listener, ctx); - } while(0); + wl_display_flush(ctx->display); + wl_display_dispatch(ctx->display); + wl_display_roundtrip(ctx->display); } static void @@ -1289,6 +1287,8 @@ controller_listener_surface(void *data, ivi_controller_surface_add_listener(ctx_surf->controller, &controller_surface_listener, ctx); wl_display_flush(ctx->display); + wl_display_dispatch(ctx->display); + wl_display_roundtrip(ctx->display); } static void @@ -1605,6 +1605,10 @@ wayland_getPropertiesOfLayer(t_ilm_uint layerID, ctx, (uint32_t)layerID); if (ctx_layer != NULL) { + wl_display_flush(ctx->display); + wayland_controller_display_dispatch(ctx); + wl_display_roundtrip(ctx->display); + *pLayerProperties = ctx_layer->prop; returnValue = ILM_SUCCESS; } |