ilmControl: Reverse layer ids.
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Thu, 19 Jun 2014 06:11:22 +0000 (15:11 +0900)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Sat, 21 Jun 2014 13:17:30 +0000 (22:17 +0900)
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c

index 6fd7dbc..4c97b10 100644 (file)
@@ -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;
                     }
 
                 }