From 8e4e9cb2e1af6cabbada30f7d19b65b452dc7e6d Mon Sep 17 00:00:00 2001 From: Nobuhiko Tanibata Date: Mon, 16 Jun 2014 18:42:51 +0900 Subject: Clear pending list and order list when layer removed. Signed-off-by: Nobuhiko Tanibata --- ivi-shell/ivi-layout.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index f8aaba9e..0e7492a4 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -992,6 +992,42 @@ send_prop(struct ivi_layout *layout) } } +static void +clear_surface_pending_list(struct ivi_layout_layer *ivilayer) +{ + struct ivi_layout_surface *surface_link = NULL; + struct ivi_layout_surface *surface_next = NULL; + + wl_list_for_each_safe(surface_link, surface_next, + &ivilayer->pending.list_surface, pending.link) { + if (!wl_list_empty(&surface_link->pending.link)) { + wl_list_remove(&surface_link->pending.link); + } + + wl_list_init(&surface_link->pending.link); + } + + ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE; +} + +static void +clear_surface_order_list(struct ivi_layout_layer *ivilayer) +{ + struct ivi_layout_surface *surface_link = NULL; + struct ivi_layout_surface *surface_next = NULL; + + wl_list_for_each_safe(surface_link, surface_next, + &ivilayer->order.list_surface, order.link) { + if (!wl_list_empty(&surface_link->order.link)) { + wl_list_remove(&surface_link->order.link); + } + + wl_list_init(&surface_link->order.link); + } + + ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE; +} + /** * Exported APIs of ivi-layout library are implemented from here. * Brief of APIs is described in ivi-layout-export.h. @@ -1733,6 +1769,9 @@ ivi_layout_layerRemove(struct ivi_layout_layer *ivilayer) } } + clear_surface_pending_list(ivilayer); + clear_surface_order_list(ivilayer); + if (!wl_list_empty(&ivilayer->pending.link)) { wl_list_remove(&ivilayer->pending.link); } -- cgit v1.2.1