diff options
author | Marcus Fritzsch <marcus.fritzsch@xse.de> | 2014-07-04 16:04:55 +0200 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp> | 2014-08-12 22:15:11 +0900 |
commit | 2d7f5698054648c533b7fa501c0621f06aabc876 (patch) | |
tree | dba1a62c60cd78dd770cdcbd7b9434c211169ad6 | |
parent | a55046e4128a24d8bc26d970b057e5061e525b42 (diff) | |
download | wayland-ivi-extension-2d7f5698054648c533b7fa501c0621f06aabc876.tar.gz |
ilmControl: Minor fix to create_controller_layer()
* Pulled the check for existing layer out of the function.
Signed-off-by: Marcus Fritzsch <marcus.fritzsch@xse.de>
-rw-r--r-- | ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c | 14 |
1 files changed, 8 insertions, 6 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 a8777a9..d66e71d 100644 --- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c @@ -1315,7 +1315,14 @@ controller_listener_layer_for_child(void *data, struct ivi_controller *controller, uint32_t id_layer) { - create_controller_layer(data, 0, 0, id_layer); + struct wayland_context *ctx = data; + + if (wayland_controller_is_inside_layer_list(&ctx->list_layer, id_layer)) + { + return; + } + + (void) create_controller_layer(ctx, 0, 0, id_layer); } static void @@ -2108,11 +2115,6 @@ wayland_getSurfaceIDsOnLayer(t_ilm_layer layer, static int create_controller_layer(struct wayland_context *ctx, t_ilm_uint width, t_ilm_uint height, t_ilm_layer layerid) { - if (wayland_controller_get_layer_context(ctx, layerid)) - { - return -1; - } - struct layer_context *ctx_layer = calloc(1, sizeof *ctx_layer); if (ctx_layer == NULL) { fprintf(stderr, "Failed to allocate memory for layer_context\n"); |