aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-06-23 12:41:25 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commitd90e97b2838053165eaf6a21906991d4c8faaac7 (patch)
tree41a55cebb13bfecfddbb9f95466ea6448b4ea673 /src
parentd34b46aae11efe3f5060067d1f2ee3ed3eac2b7e (diff)
wayland: set surfaces fullscreen when configured.
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp3
-rw-r--r--src/wayland.cpp12
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);
});
}