diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-09-10 13:32:14 +0900 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-10-28 12:16:54 +0900 |
commit | 9476e1c02025f6acfea15c8e452bea73b73f4c22 (patch) | |
tree | 42e79026b06dc40305fbd1c9b3bc5b1f6992c43d | |
parent | 84851cbada5b562204c216509b62032809a42195 (diff) | |
download | weston-9476e1c02025f6acfea15c8e452bea73b73f4c22.tar.gz |
ivi-shell: send ivi_surface configure event when ivi_layout_surface configured signal emitted.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
-rw-r--r-- | ivi-shell/ivi-shell.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index d7d7bb56..514de8ea 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -50,6 +50,7 @@ struct ivi_shell_surface { + struct wl_resource* resource; struct ivi_shell *shell; struct ivi_layout_surface *layout_surface; @@ -60,6 +61,8 @@ struct ivi_shell_surface int32_t height; struct wl_list link; + + struct wl_listener configured_listener; }; struct ivi_shell_setting @@ -78,6 +81,8 @@ static struct ivi_layout_interface *ivi_layout; * Implementation of ivi_surface */ +static void surface_configure_notify(struct wl_listener *listener, void *data); + static void ivi_shell_surface_configure(struct weston_surface *, int32_t, int32_t); @@ -137,6 +142,7 @@ surface_destroy(struct wl_client *client, struct wl_resource *resource) ivisurf->surface->configure_private = NULL; ivisurf->surface = NULL; ivi_layout->surfaceSetNativeContent(NULL, 0, 0, ivisurf->id_surface); + ivi_layout->remove_surface_configured_listener(ivisurf->layout_surface, &ivisurf->configured_listener); } wl_resource_destroy(resource); @@ -239,9 +245,13 @@ application_surface_create(struct wl_client *client, ivisurf->id_surface = id_surface; } + ivisurf->resource = res; ivisurf->width = 0; ivisurf->height = 0; ivisurf->layout_surface = layout_surface; + ivisurf->configured_listener.notify = surface_configure_notify; + ivi_layout->add_surface_configured_listener(layout_surface, &ivisurf->configured_listener); + ivisurf->surface = weston_surface; weston_surface->configure = ivi_shell_surface_configure; @@ -378,6 +388,24 @@ ivi_load_modules(struct weston_compositor *compositor, const char *modules, return 0; } +static void +surface_configure_notify(struct wl_listener *listener, void *data) +{ + struct ivi_layout_surface* layout_surf = + (struct ivi_layout_surface*) data; + + struct ivi_shell_surface *shell_surf = + container_of(listener, + struct ivi_shell_surface, + configured_listener); + + int32_t dim[2] = {}; + ivi_layout->get_surface_dimension(layout_surf, dim); + + ivi_surface_send_configure(shell_surf->resource, dim[0], dim[1]); + +} + WL_EXPORT int module_init(struct weston_compositor *compositor, int *argc, char *argv[]) |