From 88aef2fe01aad082c5e0c8c4c463b323f16612c7 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Wed, 17 Aug 2016 14:59:49 +0900 Subject: [PATCH] e_output: Sort list of planes by zpos Change-Id: Id75dfbbe5a83239a196bbed4f775335c7b4f8b9b --- src/bin/e_output.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/bin/e_output.c b/src/bin/e_output.c index 11ebc74..8639706 100644 --- a/src/bin/e_output.c +++ b/src/bin/e_output.c @@ -193,6 +193,18 @@ _output_type_to_str(tdm_output_type output_type) else return "Unknown"; } +static int +_e_output_planes_sort_cb(const void *d1, const void *d2) +{ + E_Plane *plane1 = (E_Plane *)d1; + E_Plane *plane2 = (E_Plane *)d2; + + if(!plane1) return(1); + if(!plane2) return(-1); + + return(plane1->zpos > plane2->zpos); +} + EINTERN E_Output * e_output_new(E_Comp_Screen *e_comp_screen, int index) { @@ -260,8 +272,9 @@ e_output_new(E_Comp_Screen *e_comp_screen, int index) output->planes = eina_list_append(output->planes, plane); } - output->e_comp_screen = e_comp_screen; + output->planes = eina_list_sort(output->planes, eina_list_count(output->planes), _e_output_planes_sort_cb); + output->e_comp_screen = e_comp_screen; return output; -- 2.7.4