Commit 814cd1c0 authored by Michael Olbrich's avatar Michael Olbrich

ivi-layout: make sure hidden surfaces can make progress

Add all invisible surfaces to a hidden weston layer. Without this,
applications that are hidden from the beginning will not make any progess.

Also, always update properties. This is necessary for proper communication
with clients for invisible surfaces. This is probably also more correct:
When a layer is removed from a screen, then the area below is currently not
damaged. And the area below invisible views is damaged every time, not just
once when it it hidden.
Always call update_prop() instead. This will only trigger updates for any
visibility or geometry changes.
Signed-off-by: Michael Olbrich's avatarMichael Olbrich <m.olbrich@pengutronix.de>
parent bff27cb8
Pipeline #5521 passed with stage
in 3 minutes and 15 seconds
...@@ -107,6 +107,7 @@ struct ivi_layout { ...@@ -107,6 +107,7 @@ struct ivi_layout {
} surface_notification; } surface_notification;
struct weston_layer layout_layer; struct weston_layer layout_layer;
struct weston_layer hidden_layer;
struct ivi_layout_transition_set *transitions; struct ivi_layout_transition_set *transitions;
struct wl_list pending_transition_list; /* transition_node::link */ struct wl_list pending_transition_list; /* transition_node::link */
......
...@@ -589,43 +589,10 @@ update_prop(struct ivi_layout_view *ivi_view) ...@@ -589,43 +589,10 @@ update_prop(struct ivi_layout_view *ivi_view)
static void static void
commit_changes(struct ivi_layout *layout) commit_changes(struct ivi_layout *layout)
{ {
struct ivi_layout_screen *iviscrn = NULL;
struct ivi_layout_layer *ivilayer = NULL;
struct ivi_layout_surface *ivisurf = NULL;
struct ivi_layout_view *ivi_view = NULL; struct ivi_layout_view *ivi_view = NULL;
wl_list_for_each(ivi_view, &layout->view_list, link) { wl_list_for_each(ivi_view, &layout->view_list, link)
ivisurf = ivi_view->ivisurf;
ivilayer = ivi_view->on_layer;
iviscrn = ivilayer->on_screen;
/*
* If the view is not on the currently rendered scenegraph,
* we do not need to update its properties.
*/
if (wl_list_empty(&ivi_view->order_link) || !iviscrn)
continue;
/*
* If the view's layer or surface is invisible, we do not need
* to update its properties.
*/
if (!ivilayer->prop.visibility || !ivisurf->prop.visibility) {
/*
* If ivilayer or ivisurf of ivi_view is made invisible
* in this commit_changes call, we have to damage
* the weston_view below this ivi_view. Otherwise content
* of this ivi_view will stay visible.
*/
if ((ivilayer->prop.event_mask | ivisurf->prop.event_mask) &
IVI_NOTIFICATION_VISIBILITY)
weston_view_damage_below(ivi_view->view);
continue;
}
update_prop(ivi_view); update_prop(ivi_view);
}
} }
static void static void
...@@ -784,6 +751,7 @@ commit_screen_list(struct ivi_layout *layout) ...@@ -784,6 +751,7 @@ commit_screen_list(struct ivi_layout *layout)
/* Clear view list of layout ivi_layer */ /* Clear view list of layout ivi_layer */
wl_list_init(&layout->layout_layer.view_list.link); wl_list_init(&layout->layout_layer.view_list.link);
wl_list_init(&layout->hidden_layer.view_list.link);
wl_list_for_each(iviscrn, &layout->screen_list, link) { wl_list_for_each(iviscrn, &layout->screen_list, link) {
if (iviscrn->order.dirty) { if (iviscrn->order.dirty) {
...@@ -812,14 +780,17 @@ commit_screen_list(struct ivi_layout *layout) ...@@ -812,14 +780,17 @@ commit_screen_list(struct ivi_layout *layout)
} }
wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) { wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) {
struct weston_layer *weston_layer;
if (ivilayer->prop.visibility == false) if (ivilayer->prop.visibility == false)
continue; weston_layer = &layout->hidden_layer;
else
weston_layer = &layout->layout_layer;
wl_list_for_each(ivi_view, &ivilayer->order.view_list, order_link) { wl_list_for_each(ivi_view, &ivilayer->order.view_list, order_link) {
if (ivi_view->ivisurf->prop.visibility == false) if (ivi_view->ivisurf->prop.visibility == false)
continue; weston_layer = &layout->layout_layer;
weston_layer_entry_insert(&layout->layout_layer.view_list, weston_layer_entry_insert(&weston_layer->view_list,
&ivi_view->view->layer_link); &ivi_view->view->layer_link);
ivi_view->ivisurf->surface->is_mapped = true; ivi_view->ivisurf->surface->is_mapped = true;
...@@ -1934,6 +1905,9 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec) ...@@ -1934,6 +1905,9 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec)
weston_layer_init(&layout->layout_layer, ec); weston_layer_init(&layout->layout_layer, ec);
weston_layer_set_position(&layout->layout_layer, weston_layer_set_position(&layout->layout_layer,
WESTON_LAYER_POSITION_NORMAL); WESTON_LAYER_POSITION_NORMAL);
weston_layer_init(&layout->hidden_layer, ec);
weston_layer_set_position(&layout->hidden_layer,
WESTON_LAYER_POSITION_HIDDEN);
create_screen(ec); create_screen(ec);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment