From 3bfefb8cc00bdf007ec1b99ce61cebf973e12b92 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Fri, 23 Jun 2017 14:47:39 +0200 Subject: [PATCH] wayland: initialize layer members Signed-off-by: Marcus Fritzsch --- src/wayland.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/wayland.cpp b/src/wayland.cpp index 098ee47..b644313 100644 --- a/src/wayland.cpp +++ b/src/wayland.cpp @@ -309,8 +309,14 @@ constexpr struct ivi_controller_layer_listener layer_listener = { layer::layer(uint32_t i, struct controller *c) : layer(i, 0, 0, c) {} layer::layer(uint32_t i, int32_t w, int32_t h, struct controller *c) - : wayland_proxy(ivi_controller_layer_create(c->proxy, i, w, h)), - controlled_entity(c, i) { + : wayland_proxy(ivi_controller_layer_create(c->proxy, i, w, h)) + , controlled_entity(c, i) + , dst_rect{} + , src_rect{} + , size{} + , orientation{} + , visibility{} + , opacity{} { ivi_controller_layer_add_listener(this->proxy, &layer_listener, this); } @@ -514,8 +520,10 @@ void controller::surface_configuration(uint32_t id, int32_t width, logdebug("genivi::surface %s @ %p w %i h %i", __func__, this->proxy, width, height); auto &s = this->surfaces[id]; + bool center = int(s->size.w) != int(width) && int(s->size.h) != int(height); s->size = size{uint32_t(width), uint32_t(height)}; + if (center) add_task("fullscreen surface", [id](struct controller *c) { c->surfaces[id]->set_destination_rectangle(0, 0, c->output_size.w, -- 2.16.6