X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fshell.c;h=cbe1252d0d3e743aa8609befc648f5b5dcb53104;hb=refs%2Fheads%2Fneedlefish;hp=efcb102e2e3363c21bce4828780712566932e02b;hpb=71deafe03f41738bfcd7eafd21c3262c29f45ee7;p=src%2Fagl-compositor.git diff --git a/src/shell.c b/src/shell.c index efcb102..cbe1252 100644 --- a/src/shell.c +++ b/src/shell.c @@ -49,18 +49,6 @@ static void create_black_surface_view(struct ivi_output *output); -static struct ivi_surface * -get_ivi_shell_surface(struct weston_surface *wsurface) -{ - if (weston_surface_is_desktop_surface(wsurface)) { - struct weston_desktop_surface *dsurface = - weston_surface_get_desktop_surface(wsurface); - return weston_desktop_surface_get_user_data(dsurface); - } - - return NULL; -} - void agl_shell_desktop_advertise_application_id(struct ivi_compositor *ivi, struct ivi_surface *surface) @@ -99,6 +87,16 @@ ivi_set_desktop_surface(struct ivi_surface *surface) agl_shell_desktop_advertise_application_id(ivi, 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) { @@ -479,7 +477,7 @@ ivi_set_pending_desktop_surface_remote(struct ivi_output *ioutput, if (!p_remote) return; - wl_list_insert(&ivi->remote_pending_apps, &remote->link); + wl_list_insert(&ivi->remote_pending_apps, &p_remote->link); } @@ -638,14 +636,9 @@ ivi_check_pending_surface_desktop(struct ivi_surface *surface, const char *app_id = weston_desktop_surface_get_app_id(surface->dsurface); - if (!app_id) { - *role = IVI_SURFACE_ROLE_NONE; - return; - } - role_pending_list = &ivi->popup_pending_apps; wl_list_for_each(p_popup, role_pending_list, link) { - if (!strcmp(app_id, p_popup->app_id)) { + if (app_id && !strcmp(app_id, p_popup->app_id)) { *role = IVI_SURFACE_ROLE_POPUP; return; } @@ -653,7 +646,7 @@ ivi_check_pending_surface_desktop(struct ivi_surface *surface, role_pending_list = &ivi->split_pending_apps; wl_list_for_each(p_split, role_pending_list, link) { - if (!strcmp(app_id, p_split->app_id)) { + if (app_id && !strcmp(app_id, p_split->app_id)) { *role = IVI_SURFACE_ROLE_SPLIT_V; return; } @@ -661,7 +654,7 @@ ivi_check_pending_surface_desktop(struct ivi_surface *surface, role_pending_list = &ivi->fullscreen_pending_apps; wl_list_for_each(p_fullscreen, role_pending_list, link) { - if (!strcmp(app_id, p_fullscreen->app_id)) { + if (app_id && !strcmp(app_id, p_fullscreen->app_id)) { *role = IVI_SURFACE_ROLE_FULLSCREEN; return; } @@ -669,7 +662,7 @@ ivi_check_pending_surface_desktop(struct ivi_surface *surface, role_pending_list = &ivi->remote_pending_apps; wl_list_for_each(p_remote, role_pending_list, link) { - if (!strcmp(app_id, p_remote->app_id)) { + if (app_id && !strcmp(app_id, p_remote->app_id)) { *role = IVI_SURFACE_ROLE_REMOTE; return; } @@ -784,18 +777,11 @@ ivi_shell_destroy_views_on_layer(struct weston_layer *layer) } } -static void -ivi_shell_destroy_views_on_fullscreen_layer(struct ivi_compositor *ivi) -{ - struct ivi_output *ivi_output; - - wl_list_for_each(ivi_output, &ivi->outputs, link) - weston_surface_destroy(ivi_output->fullscreen_view.fs->view->surface); -} - void ivi_shell_finalize(struct ivi_compositor *ivi) { + struct ivi_output *output; + ivi_shell_destroy_views_on_layer(&ivi->hidden); weston_layer_fini(&ivi->hidden); @@ -811,7 +797,12 @@ ivi_shell_finalize(struct ivi_compositor *ivi) ivi_shell_destroy_views_on_layer(&ivi->popup); weston_layer_fini(&ivi->popup); - ivi_shell_destroy_views_on_fullscreen_layer(ivi); + wl_list_for_each(output, &ivi->outputs, link) { + if (output->fullscreen_view.fs->view) { + weston_surface_destroy(output->fullscreen_view.fs->view->surface); + output->fullscreen_view.fs->view = NULL; + } + } weston_layer_fini(&ivi->fullscreen); } @@ -1043,8 +1034,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_surface(output); + } + ivi_layout_init(ivi, output); }