From d90e97b2838053165eaf6a21906991d4c8faaac7 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Fri, 23 Jun 2017 12:41:25 +0200 Subject: [PATCH] wayland: set surfaces fullscreen when configured. Signed-off-by: Marcus Fritzsch --- src/main.cpp | 3 +++ src/wayland.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 67687af..20f04e5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -64,6 +64,9 @@ void init_layout(struct conn &c) { struct genivi::screen &s = *c.c->screens.begin()->second; auto &layers = c.c->layers; + // XXX: Write output dimensions to ivi controller... + c.c->output_size = genivi::size{uint32_t(o.width), uint32_t(o.height)}; + // Setup our dummy scene... if (layers.find(100) == layers.end()) { logdebug("Creating layer 100 with output dimensions (%ux%u)", o.width, o.height); diff --git a/src/wayland.cpp b/src/wayland.cpp index a512979..3983da8 100644 --- a/src/wayland.cpp +++ b/src/wayland.cpp @@ -514,14 +514,14 @@ void controller::surface_configuration(uint32_t id, int32_t width, logdebug("genivi::surface %s @ %p w %i h %i", __func__, this->proxy, width, height); struct surface *s = this->surfaces[id].get(); - bool center = s->size.w != width && s->size.h != height; + 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) - auto const s = c->surfaces.find(id); - if (s != c->surfaces.end()) - s->second->set_destination_rectangle( - 800 / 2 - width / 2, 600 / 2 - height / 2, width, height); - add_task("fullscreen surface", [id, width, height](struct controller *c) { + add_task("fullscreen surface", [id](struct controller *c) { + c->surfaces[id]->set_destination_rectangle(0, 0, c->output_size.w, c->output_size.h); + c->surfaces[id]->set_visibility(1); + c->layers[100]->add_surface(c->surfaces[id].get()); + c->layers[100]->set_visibility(1); }); } -- 2.16.6