diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-06-03 02:11:34 -0700 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-06-17 10:15:03 +0900 |
commit | c51e0e00e2f29a33ae39eccc2d981db46e53ea5a (patch) | |
tree | 196e5e476e2243b9b850c8f76e85383ee4d342ec | |
parent | 1f107fee3b4c7d9ebe49a60630f2ce2cf330fce5 (diff) | |
download | wayland-ivi-extension-c51e0e00e2f29a33ae39eccc2d981db46e53ea5a.tar.gz |
ilmClient and ilmControl: Avoid duplicative auto generation numbers about surface and layer
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
-rw-r--r-- | ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c | 8 | ||||
-rw-r--r-- | ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c index a7fb1a9..9a9c99b 100644 --- a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c +++ b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c @@ -123,12 +123,18 @@ wayland_client_gen_surface_id(struct ilm_client_context *ctx) { struct surface_context *ctx_surf = NULL; do { + int found = 0; if (wl_list_length(&ctx->list_surface) == 0) { ctx->internal_id_surface++; return ctx->internal_id_surface; } wl_list_for_each(ctx_surf, &ctx->list_surface, link) { - if (ctx_surf->id_surface != ctx->internal_id_surface) { + if (ctx_surf->id_surface == ctx->internal_id_surface) { + found = 1; + break; + } + + if (found == 0) { return ctx->internal_id_surface; } } 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 0679ae7..161cde2 100644 --- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c @@ -1813,12 +1813,18 @@ gen_layer_id(struct ilm_control_context *ctx) { struct layer_context *ctx_layer = NULL; do { + int found = 0; if (wl_list_length(&ctx->main_ctx.list_layer) == 0) { ctx->internal_id_layer++; return ctx->internal_id_layer; } wl_list_for_each(ctx_layer, &ctx->main_ctx.list_layer, link) { - if (ctx_layer->id_layer != ctx->internal_id_layer) { + if (ctx_layer->id_layer == ctx->internal_id_layer) { + found = 1; + break; + } + + if (found == 0) { return ctx->internal_id_layer; } } |