summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-06-23 15:51:12 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit304eff45622c058bacad63326d5ffc2b8f75b8da (patch)
treeba61388f30e55e819cb074e5eedbf5b18931003a
parent0b465f48da16c2e4f634a53892705c7ecc885ece (diff)
wayland: set surface layout in controller::surface
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r--src/wayland.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/wayland.cpp b/src/wayland.cpp
index c660bec..0862475 100644
--- a/src/wayland.cpp
+++ b/src/wayland.cpp
@@ -227,6 +227,16 @@ void controller::controller_layer(uint32_t id) {
void controller::controller_surface(uint32_t id) {
logdebug("genivi::controller @ %p surface %u (%x)", this->proxy, id, id);
this->surfaces[id] = std::make_unique<struct surface>(id, this);
+
+ 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);
+ uint32_t lid = id == 0x16180 ? 1000 : 100;
+ c->layers[lid]->add_surface(c->surfaces[id].get());
+ c->layers[lid]->set_visibility(1);
+ logdebug("Surface %u now fullscreen on layer %u", id, lid);
+ });
}
void controller::controller_error(int32_t object_id, int32_t object_type,
@@ -518,21 +528,7 @@ void controller::surface_configuration(uint32_t id, int32_t width,
int32_t height) {
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,
- c->output_size.h);
- c->surfaces[id]->set_visibility(1);
- uint32_t lid = id == 0x16180 ? 1000 : 100;
- c->layers[lid]->add_surface(c->surfaces[id].get());
- c->layers[lid]->set_visibility(1);
- logdebug("Surface %u now fullscreen on layer %u", id, lid);
- });
+ this->surfaces[id]->size = size{uint32_t(width), uint32_t(height)};
}
void controller::surface_orientation(uint32_t id, int32_t orientation) {