downstream: ivi-shell: fix the layout-layer clearing in commit_list_screen()
authorJanos Kovacs <jankovac503@gmail.com>
Fri, 8 Aug 2014 23:53:56 +0000 (02:53 +0300)
committerJanos Kovacs <jankovac503@gmail.com>
Wed, 10 Dec 2014 14:28:04 +0000 (16:28 +0200)
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 <jankovac503@gmail.com>
ivi-shell/ivi-layout.c

index 89908bb..9383bfc 100644 (file)
@@ -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;