From 8171dae26c2f7b9377d5861620be2bef06f44d5c Mon Sep 17 00:00:00 2001 From: Janos Kovacs Date: Sat, 9 Aug 2014 02:53:56 +0300 Subject: [PATCH] downstream: ivi-shell: fix the layout-layer clearing in commit_list_screen() The original implementation initialized the list-head of the layer's view_list and re-built the list by adding the views of the visible surfaces to the list. This left the layer_link of non-visible views to point to their neighbours in the previous arrangement. This was no problem as long as those views were not unmapped or destructed, eg. a non-visible surface was removed. The fixed version goes through on the list and initializes the layer_link's making view destructions and unmappings safe. Change-Id: I93b1398064228b5189782ac9030ff9515abd5283 Signed-off-by: Janos Kovacs --- ivi-shell/ivi-layout.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 89908bb..9383bfc 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -886,6 +886,13 @@ commit_screen_list(struct ivi_layout *layout) struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_layer *next = NULL; struct ivi_layout_surface *ivisurf = NULL; + struct weston_view *view, *n; + + /* clear view list of layout layer */ + wl_list_for_each_safe(view, n, &layout->layout_layer.view_list.link, layer_link.link) { + weston_layer_entry_remove(&view->layer_link); + } + wl_list_for_each(iviscrn, &layout->screen_list, link) { if (iviscrn->event_mask & IVI_NOTIFICATION_REMOVE) { @@ -926,9 +933,7 @@ commit_screen_list(struct ivi_layout *layout) iviscrn->event_mask = 0; - /* Clear view list of layout ivi_layer */ - wl_list_init(&layout->layout_layer.view_list.link); - + /* rebuild view list of layout layer */ wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) { if (ivilayer->prop.visibility == false) continue; -- 2.7.4