From 8021956edbc26873682589a5a2cba912e0d0cf26 Mon Sep 17 00:00:00 2001 From: Nobuhiko Tanibata Date: Thu, 19 Jun 2014 15:11:22 +0900 Subject: [PATCH] ilmControl: Reverse layer ids. Signed-off-by: Nobuhiko Tanibata --- .../ilmControl/src/ilm_control_wayland_platform.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 6fd7dbc..4c97b10 100644 --- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c @@ -2232,7 +2232,7 @@ create_layerids(struct screen_context *ctx_screen, } ids = *layer_ids; - wl_list_for_each(ctx_layer, &ctx_screen->order.list_layer, order.link) { + wl_list_for_each_reverse(ctx_layer, &ctx_screen->order.list_layer, order.link) { *ids = (t_ilm_layer)ctx_layer->id_layer; ids++; } @@ -2322,11 +2322,11 @@ wayland_getLayerIDs(t_ilm_int* pLength, t_ilm_layer** ppArray) if (*ppArray != NULL) { // compositor sends layers in opposite order // write ids from back to front to turn them around - t_ilm_layer* ids = &((*ppArray)[length - 1]); - wl_list_for_each(ctx_layer, &ctx->main_ctx.list_layer, link) + t_ilm_layer* ids = *ppArray; + wl_list_for_each_reverse(ctx_layer, &ctx->main_ctx.list_layer, link) { *ids = ctx_layer->id_layer; - --ids; + ++ids; } *pLength = length; @@ -2358,11 +2358,11 @@ wayland_getLayerIDsOnScreen(t_ilm_uint screenId, if (*ppArray != NULL) { // compositor sends layers in opposite order // write ids from back to front to turn them around - t_ilm_layer* ids = &((*ppArray)[length - 1]); - wl_list_for_each(ctx_layer, &ctx->main_ctx.list_layer, link) + t_ilm_layer* ids = *ppArray; + wl_list_for_each_reverse(ctx_layer, &ctx->main_ctx.list_layer, link) { *ids = ctx_layer->id_layer; - --ids; + ++ids; } } -- 2.7.4