desktop: Delay surface creation until committed
[src/agl-compositor.git] / src / shell.c
index 87d8ce9..941257a 100644 (file)
@@ -107,6 +107,20 @@ ivi_set_desktop_surface_fullscreen(struct ivi_surface *surface)
        agl_shell_desktop_advertise_application_id(ivi, surface);
 }
 
+void
+ivi_destroy_waltham_destroy(struct ivi_surface *surface)
+{
+       struct ivi_compositor *ivi = surface->ivi;
+       const struct weston_transmitter_api *api =
+               ivi->waltham_transmitter_api;
+
+       if (!api)
+               return;
+
+       if (surface->waltham_surface.transmitter_surface)
+               api->surface_destroy(surface->waltham_surface.transmitter_surface);
+}
+
 static void
 ivi_output_notify_waltham_plugin(struct ivi_surface *surface)
 {
@@ -159,7 +173,8 @@ ivi_output_notify_waltham_plugin(struct ivi_surface *surface)
         * wthp_ivi_app_id_surface_create() and is responsible for setting-up
         * the gstreamer pipeline as well.
         */
-       api->surface_push_to_remote(weston_surface, app_id, trans_remote, NULL);
+       surface->waltham_surface.transmitter_surface =
+           api->surface_push_to_remote(weston_surface, app_id, trans_remote, NULL);
 }
 
 static void
@@ -732,6 +747,7 @@ shell_ready(struct wl_client *client, struct wl_resource *shell_res)
        wl_list_for_each_safe(surface, tmp, &ivi->pending_surfaces, link) {
                wl_list_remove(&surface->link);
                ivi_check_pending_desktop_surface(surface);
+               surface->checked_pending = true;
        }
 }
 
@@ -771,6 +787,7 @@ shell_set_background(struct wl_client *client,
                return;
        }
 
+       surface->checked_pending = true;
        surface->role = IVI_SURFACE_ROLE_BACKGROUND;
        surface->bg.output = output;
        wl_list_remove(&surface->link);
@@ -843,6 +860,7 @@ shell_set_panel(struct wl_client *client,
                return;
        }
 
+       surface->checked_pending = true;
        surface->role = IVI_SURFACE_ROLE_PANEL;
        surface->panel.output = output;
        surface->panel.edge = edge;