diff --git a/ivi-shell/ivi-layout-shell.h b/ivi-shell/ivi-layout-shell.h index 63f66fa9..1c10a8ba 100644 --- a/ivi-shell/ivi-layout-shell.h +++ b/ivi-shell/ivi-layout-shell.h @@ -44,7 +44,8 @@ ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf, int32_t width, int32_t height); struct ivi_layout_surface* -ivi_layout_desktop_surface_create(struct weston_surface *wl_surface); +ivi_layout_desktop_surface_create(struct weston_surface *wl_surface, + struct weston_desktop_surface *surface); void ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 0f0f4f8a..e685e356 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1882,7 +1882,6 @@ ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf, ivisurf->id_surface = id_surface; - wl_signal_emit(&layout->surface_notification.created, ivisurf); wl_signal_emit(&layout->surface_notification.configure_changed, ivisurf); @@ -1979,9 +1978,20 @@ ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf, } struct ivi_layout_surface* -ivi_layout_desktop_surface_create(struct weston_surface *wl_surface) +ivi_layout_desktop_surface_create(struct weston_surface *wl_surface, + struct weston_desktop_surface *surface) { - return surface_create(wl_surface, IVI_INVALID_ID); + struct ivi_layout *layout = get_instance(); + struct ivi_layout_surface *ivisurf; + + ivisurf = surface_create(wl_surface, IVI_INVALID_ID); + + if (ivisurf) { + ivisurf->weston_desktop_surface = surface; + wl_signal_emit(&layout->surface_notification.created, ivisurf); + } + + return ivisurf; } void diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 5ec1349e..eb6bbbe7 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -489,13 +489,11 @@ desktop_surface_added(struct weston_desktop_surface *surface, struct weston_surface *weston_surf = weston_desktop_surface_get_surface(surface); - layout_surface = ivi_layout_desktop_surface_create(weston_surf); + layout_surface = ivi_layout_desktop_surface_create(weston_surf, surface); if (!layout_surface) { return; } - layout_surface->weston_desktop_surface = surface; - ivisurf = zalloc(sizeof *ivisurf); if (!ivisurf) { return;