summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-09-10 13:32:14 +0900
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-09-22 17:24:46 +0900
commit638a3c5ab5a0b1125facb09b4d0860cbaf879545 (patch)
treed62b532b3d3d32ed9789ee1a5ffbf1f30875af89
parent3b465d58590247bd45615ba3bbbfcde8081f5177 (diff)
downloadweston-638a3c5ab5a0b1125facb09b4d0860cbaf879545.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.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index bf4affdf..468e66a9 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -57,6 +57,7 @@ extern keyboard_key keyboard_key_func;
struct ivi_shell_surface
{
+ struct wl_resource* resource;
struct ivi_shell *shell;
struct ivi_layout_surface *layout_surface;
@@ -67,6 +68,8 @@ struct ivi_shell_surface
int32_t height;
struct wl_list link;
+
+ struct wl_listener configured_listener;
};
struct ivi_shell_setting
@@ -85,6 +88,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);
@@ -144,6 +149,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);
@@ -246,9 +252,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;
@@ -385,6 +395,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[])