}
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++;
}
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;
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;
}
}