Skip to content
Snippets Groups Projects
Commit f6638a7f authored by eucan's avatar eucan
Browse files

ivi-shell: unmap views which are not in scenegraph


From Michael Olbrich:
"Both the core in weston_compositor_build_view_list() with view.link
and the ivi-shell in commit_screen_list() with view.layer_link
don't remove the old views from the list.

As a result, all views that are not currently in the list have
old broken links. Destroying such a view tries to remove
the view from these lists and will access the old, invalid pointers."

Therefore, we have to unmap weston_views which are not in current
scenegraph of ivi-shell. I implemented ivi_view_is_mapped() function
to check mappedness of ivi_views. The functions checks:
   - the view is on a layer's order list
   - the layer is on a screen
   - the layer and view's ivi_surface are visible

If ivi_view is not mapped but weston_view is still mapped,
we have to unmap the weston_view with weston_view_unmap() call.

Reported-by: default avatarMichael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: default avatarEmre Ucan <eucan@de.adit-jv.com>
parent e1e7ebdb
No related branches found
No related tags found
1 merge request!42ivi-shell: unmap views which are not in scenegraph
......@@ -586,6 +586,15 @@ update_prop(struct ivi_layout_view *ivi_view)
weston_view_schedule_repaint(ivi_view->view);
}
static bool
ivi_view_is_mapped(struct ivi_layout_view *ivi_view)
{
return (!wl_list_empty(&ivi_view->order_link) &&
ivi_view->on_layer->on_screen &&
ivi_view->on_layer->prop.visibility &&
ivi_view->ivisurf->prop.visibility);
}
static void
commit_changes(struct ivi_layout *layout)
{
......@@ -816,6 +825,14 @@ build_view_list(struct ivi_layout *layout)
struct ivi_layout_layer *ivilayer;
struct ivi_layout_view *ivi_view;
/* If ivi_view is not part of the scenegrapgh, we have to unmap
* weston_views
*/
wl_list_for_each(ivi_view, &layout->view_list, link) {
if (!ivi_view_is_mapped(ivi_view))
weston_view_unmap(ivi_view->view);
}
/* Clear view list of layout ivi_layer */
wl_list_init(&layout->layout_layer.view_list.link);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment