compositor: Allow passing continue-without-input
[src/agl-compositor.git] / src / shell.c
index dc857fc..33a7a72 100644 (file)
 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)
@@ -640,7 +628,7 @@ ivi_check_pending_surface_desktop(struct ivi_surface *surface,
 
        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;
                }
@@ -648,7 +636,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;
                }
@@ -656,7 +644,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;
                }
@@ -664,7 +652,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;
                }
@@ -782,6 +770,8 @@ ivi_shell_destroy_views_on_layer(struct weston_layer *layer)
 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);
 
@@ -796,6 +786,14 @@ ivi_shell_finalize(struct ivi_compositor *ivi)
 
        ivi_shell_destroy_views_on_layer(&ivi->popup);
        weston_layer_fini(&ivi->popup);
+
+       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);
 }
 
 static void