X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fdesktop.c;h=efebfc167dbaf1c231b04358871fa378c934b103;hb=refs%2Fchanges%2F74%2F27374%2F3;hp=9c1dfaee70dfc63f2b37fd33b0dc820a75f9d1ca;hpb=80febb3fbcebe88a274ffa5109784d5f0ad69ca5;p=src%2Fagl-compositor.git diff --git a/src/desktop.c b/src/desktop.c index 9c1dfae..efebfc1 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -134,7 +134,7 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata) 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); @@ -169,11 +169,15 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata) 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 @@ -432,6 +436,17 @@ static const struct weston_desktop_api desktop_api = { .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) { @@ -441,5 +456,10 @@ 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; }