diff options
-rw-r--r-- | src/layout.c | 25 | ||||
-rw-r--r-- | src/shell.c | 18 |
2 files changed, 35 insertions, 8 deletions
diff --git a/src/layout.c b/src/layout.c index 96eb215..1773fc8 100644 --- a/src/layout.c +++ b/src/layout.c @@ -248,9 +248,11 @@ ivi_layout_activate_complete(struct ivi_output *output, weston_view_set_output(view, woutput); - weston_view_set_position(view, - woutput->x + output->area.x, - woutput->y + output->area.y); + + if (surf->role != IVI_SURFACE_ROLE_BACKGROUND) + weston_view_set_position(view, + woutput->x + output->area.x, + woutput->y + output->area.y); view->is_mapped = true; surf->mapped = true; @@ -275,12 +277,14 @@ ivi_layout_activate_complete(struct ivi_output *output, } } - if (output->active) { - output->active->view->is_mapped = false; - output->active->view->surface->is_mapped = false; + /* keep the background surface mapped at all times */ + if (output->active->role != IVI_SURFACE_ROLE_BACKGROUND) { + output->active->view->is_mapped = false; + output->active->view->surface->is_mapped = false; - weston_layer_entry_remove(&output->active->view->layer_link); + weston_layer_entry_remove(&output->active->view->layer_link); + } } output->previous_active = output->active; output->active = surf; @@ -941,6 +945,13 @@ ivi_layout_activate_by_surf(struct ivi_output *output, struct ivi_surface *surf) return; } + /* the background surface is already "maximized" so we don't need to + * add to the hidden layer */ + if (surf->role == IVI_SURFACE_ROLE_BACKGROUND) { + ivi_layout_activate_complete(output, surf); + return; + } + ivi_layout_add_to_hidden_layer(surf, output); } diff --git a/src/shell.c b/src/shell.c index 032e114..cefd157 100644 --- a/src/shell.c +++ b/src/shell.c @@ -92,6 +92,16 @@ ivi_set_desktop_surface(struct ivi_surface *surface) } static void +ivi_set_background_surface(struct ivi_surface *surface) +{ + struct ivi_compositor *ivi = surface->ivi; + assert(surface->role == IVI_SURFACE_ROLE_BACKGROUND); + + wl_list_insert(&surface->ivi->surfaces, &surface->link); + agl_shell_desktop_advertise_application_id(ivi, surface); +} + +static void ivi_set_desktop_surface_popup(struct ivi_surface *surface) { struct ivi_compositor *ivi = surface->ivi; @@ -1164,8 +1174,14 @@ shell_ready(struct wl_client *client, struct wl_resource *shell_res) ivi->shell_client.ready = true; wl_list_for_each(output, &ivi->outputs, link) { - if (output->background) + if (output->background && + output->background->role == IVI_SURFACE_ROLE_BACKGROUND) { + /* track the background surface role as a "regular" + * surface so we can activate it */ + ivi_set_background_surface(output->background); remove_black_curtain(output); + } + ivi_layout_init(ivi, output); } |