surface->ivi = ivi;
surface->dsurface = dsurface;
surface->role = IVI_SURFACE_ROLE_NONE;
- surface->activated_by_default = false;
+ surface->mapped = false;
surface->advertised_on_launch = false;
surface->checked_pending = false;
wl_list_init(&surface->link);
if (output && ivi->shell_client.ready) {
struct ivi_output *ivi_output = to_ivi_output(output);
- weston_log("Setting surface to initial size of surface to %dx%d\n",
- ivi_output->area.width, ivi_output->area.height);
- weston_desktop_surface_set_maximized(dsurface, true);
- weston_desktop_surface_set_size(dsurface,
- ivi_output->area.width, ivi_output->area.height);
+ /* verify if by any chance this surfaces hasn't been assigned a
+ * different role before sending the maximized state */
+ if (!ivi_check_pending_surface(surface)) {
+ weston_log("Setting surface to initial size of surface to %dx%d\n",
+ ivi_output->area.width, ivi_output->area.height);
+ weston_desktop_surface_set_maximized(dsurface, true);
+ weston_desktop_surface_set_size(dsurface,
+ ivi_output->area.width, ivi_output->area.height);
+ }
}
/*
* We delay creating "normal" desktop surfaces until later, to
.set_xwayland_position = desktop_set_xwayland_position,
};
+static void
+ivi_shell_destroy(struct wl_listener *listener, void *data)
+{
+ struct ivi_compositor *ivi = container_of(listener,
+ struct ivi_compositor, destroy_listener);
+
+ weston_desktop_destroy(ivi->desktop);
+ ivi_compositor_destroy_pending_surfaces(ivi);
+ wl_list_remove(&listener->link);
+}
+
int
ivi_desktop_init(struct ivi_compositor *ivi)
{
return -1;
}
+ if (!weston_compositor_add_destroy_listener_once(ivi->compositor,
+ &ivi->destroy_listener, ivi_shell_destroy)) {
+ return -1;
+ }
+
return 0;
}