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>
struct ivi_layout_layer *ivilayer = NULL;
struct ivi_layout_layer *next = NULL;
struct ivi_layout_surface *ivisurf = NULL;
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) {
wl_list_for_each(iviscrn, &layout->screen_list, link) {
if (iviscrn->event_mask & IVI_NOTIFICATION_REMOVE) {
- /* 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;
wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) {
if (ivilayer->prop.visibility == false)
continue;