ivi_check_pending_surface_desktop(surface, &role);
if ((role != IVI_SURFACE_ROLE_DESKTOP &&
- role != IVI_SURFACE_ROLE_FULLSCREEN) ||
+ role != IVI_SURFACE_ROLE_FULLSCREEN &&
+ role != IVI_SURFACE_ROLE_REMOTE) ||
role == IVI_SURFACE_ROLE_NONE)
return;
dclient = weston_desktop_surface_get_client(dsurface);
client = weston_desktop_client_get_client(dclient);
+ if (ivi->shell_client.resource &&
+ ivi->shell_client.status == BOUND_FAILED) {
+ wl_client_post_implementation_error(client,
+ "agl_shell has already been bound. "
+ "Check out bound_fail event");
+ return;
+ }
+
surface = zalloc(sizeof *surface);
if (!surface) {
wl_client_post_no_memory(client);
struct weston_surface *wsurface =
weston_desktop_surface_get_surface(dsurface);
const char *app_id = NULL;
- struct weston_seat *wseat = get_ivi_shell_weston_first_seat(surface->ivi);
- struct ivi_shell_seat *ivi_seat = get_ivi_shell_seat(wseat);
+ struct weston_seat *wseat = NULL;
+ struct ivi_shell_seat *ivi_seat = NULL;
+ struct ivi_output *output = NULL;
+
+ /* we might not have a valid ivi_surface if _added failed due to
+ * protocol errors */
+ if (!surface)
+ return;
+
+ wseat = get_ivi_shell_weston_first_seat(surface->ivi);
+ if (wseat)
+ ivi_seat = get_ivi_shell_seat(wseat);
- struct ivi_output *output = ivi_layout_get_output_from_surface(surface);
+ output = ivi_layout_get_output_from_surface(surface);
wl_list_remove(&surface->listener_advertise_app.link);
surface->listener_advertise_app.notify = NULL;
/* 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_remote_surfaces(output->ivi, IVI_SURFACE_ROLE_REMOTE) ||
+ desktop_surface_check_last_remote_surfaces(output->ivi, IVI_SURFACE_ROLE_DESKTOP))
if (!output->background)
insert_black_surface(output);