if (output && ivi->shell_client.ready) {
struct ivi_output *ivi_output = to_ivi_output(output);
- desktop_surface_added_configure(surface, ivi_output);
+ if (active_output)
+ desktop_surface_added_configure(surface, active_output);
+ else
+ desktop_surface_added_configure(surface, ivi_output);
}
/*
* We delay creating "normal" desktop surfaces until later, to
}
static bool
-desktop_surface_check_last_remote_surfaces(struct ivi_compositor *ivi, enum ivi_surface_role role)
+desktop_surface_check_last_surfaces(struct ivi_output *ivi_output, enum ivi_surface_role role)
{
int count = 0;
struct ivi_surface *surf;
- wl_list_for_each(surf, &ivi->surfaces, link)
- if (surf->role == role)
+ wl_list_for_each(surf, &ivi_output->ivi->surfaces, link)
+ if (surf->role == role &&
+ surf->current_completed_output == ivi_output)
count++;
return (count == 1);
/* check if there's a last 'remote' surface and insert a black
* surface view if there's no background set for that output
*/
- if ((desktop_surface_check_last_remote_surfaces(output->ivi,
- IVI_SURFACE_ROLE_REMOTE) ||
- desktop_surface_check_last_remote_surfaces(output->ivi,
- IVI_SURFACE_ROLE_DESKTOP)) && output->type == OUTPUT_REMOTE)
+ if (desktop_surface_check_last_surfaces(output, IVI_SURFACE_ROLE_REMOTE) ||
+ desktop_surface_check_last_surfaces(output, IVI_SURFACE_ROLE_DESKTOP))
if (!output->background)
- insert_black_surface(output);
+ insert_black_curtain(output);
if (weston_surface_is_mapped(wsurface)) {
weston_log("Removed surface %p, app_id %s, role %s\n", surface,
app_id, ivi_layout_get_surface_role_name(surface));
- if (app_id && output)
+ if (app_id && output) {
shell_advertise_app_state(output->ivi, app_id,
NULL, AGL_SHELL_DESKTOP_APP_STATE_DESTROYED);
+ if (output->ivi->shell_client.ready &&
+ wl_resource_get_version(output->ivi->shell_client.resource)
+ >= AGL_SHELL_APP_STATE_SINCE_VERSION)
+ agl_shell_send_app_state(output->ivi->shell_client.resource,
+ app_id, AGL_SHELL_APP_STATE_TERMINATED);
+ }
+
wl_list_remove(&surface->link);
free(surface);
wl_list_init(&surface->link);
ivi_check_pending_desktop_surface(surface);
surface->checked_pending = true;
+
+ /* we'll do it now at commit time, because we might not have an
+ * appid by the time we've created the weston_desktop_surface
+ * */
+ if (wl_resource_get_version(ivi->shell_client.resource) >= AGL_SHELL_APP_STATE_SINCE_VERSION)
+ agl_shell_send_app_state(ivi->shell_client.resource,
+ app_id, AGL_SHELL_APP_STATE_STARTED);
}
if (!surface->advertised_on_launch &&