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>
dev
Michael Olbrich 4 years ago committed by Daniel Stone
parent cd7801aa95
commit 924e79f4f2
  1. 3
      ivi-shell/ivi-layout-shell.h
  2. 16
      ivi-shell/ivi-layout.c
  3. 4
      ivi-shell/ivi-shell.c

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

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

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

Loading…
Cancel
Save