summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-06-03 02:20:37 -0700
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-06-17 10:15:04 +0900
commitb98a9c138cfc4cd43c045558d93ead8990d8be48 (patch)
treea679eb84d3859b15298b1ea46927aac7a9b95af6
parentc51e0e00e2f29a33ae39eccc2d981db46e53ea5a (diff)
downloadwayland-ivi-extension-b98a9c138cfc4cd43c045558d93ead8990d8be48.tar.gz
ilmControl: Avoid multiple registration to render order of surface.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
-rw-r--r--ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c15
1 files changed, 13 insertions, 2 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 161cde2..da76131 100644
--- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
@@ -820,6 +820,8 @@ add_ordersurface_to_layer(struct wayland_context *ctx,
struct ivi_controller_layer *layer)
{
struct layer_context *ctx_layer = NULL;
+ struct surface_context *link = NULL;
+ int found = 0;
ctx_layer = get_layer_context(ctx, layer);
if (ctx_layer == NULL) {
@@ -827,8 +829,17 @@ add_ordersurface_to_layer(struct wayland_context *ctx,
return;
}
- wl_list_init(&ctx_surf->order.link);
- wl_list_insert(&ctx_layer->order.list_surface, &ctx_surf->order.link);
+ wl_list_for_each(link, &ctx_layer->order.list_surface, order.link) {
+ if (link == ctx_surf) {
+ found = 1;
+ break;
+ }
+ }
+
+ if (found == 0) {
+ wl_list_init(&ctx_surf->order.link);
+ wl_list_insert(&ctx_layer->order.list_surface, &ctx_surf->order.link);
+ }
}
static void