summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-09-16 15:21:12 +0900
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-10-28 12:16:55 +0900
commit87b6df7a327501334bab0d209c6c1ea7bb40c712 (patch)
treee3d4e386d9667b00394053960dc413a5a8421b85
parent64fe67d9da09d2865dce1a05bd6ae7395b131a80 (diff)
downloadweston-87b6df7a327501334bab0d209c6c1ea7bb40c712.tar.gz
simple-shm: support ivi_surface configure event.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
-rw-r--r--clients/simple-shm.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/clients/simple-shm.c b/clients/simple-shm.c
index c54b5d73..123d1a2f 100644
--- a/clients/simple-shm.c
+++ b/clients/simple-shm.c
@@ -159,6 +159,33 @@ static const struct xdg_surface_listener xdg_surface_listener = {
handle_delete,
};
+static void
+handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
+ int32_t width, int32_t height)
+{
+ struct window *window = data;
+
+ if (window->buffers[0].buffer) {
+ wl_buffer_destroy(window->buffers[0].buffer);
+ window->buffers[0].buffer = NULL;
+ window->buffers[0].busy = 0;
+ }
+
+ if (window->buffers[1].buffer) {
+ wl_buffer_destroy(window->buffers[1].buffer);
+ window->buffers[1].buffer = NULL;
+ window->buffers[1].busy = 0;
+ }
+
+ window->width = width;
+ window->height = height;
+}
+
+static const struct ivi_surface_listener ivi_surface_listener = {
+ NULL,
+ handle_ivi_surface_configure,
+};
+
static struct window *
create_window(struct display *display, int width, int height)
{
@@ -200,6 +227,10 @@ create_window(struct display *display, int width, int height)
fprintf(stderr, "Failed to create ivi_client_surface\n");
abort();
}
+
+ ivi_surface_add_listener(window->ivi_surface,
+ &ivi_surface_listener, window);
+
} else {
assert(0);
}