ivi-shell: emit created notification earlier for desktop surfaces

Without this, the earliest signal the ivi controller receives for a new surface
is configure_desktop_changed signal. And this is not emitted until the surface
has the first buffer attached.
By emitting the signal during surface creation, the controller is able to set
the initial width and height for the first configure.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2021-03-17 13:58:29 +01:00 committed by Daniel Stone
parent cd7801aa95
commit 924e79f4f2
3 changed files with 16 additions and 7 deletions

View file

@ -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,

View file

@ -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

View file

@ -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;