X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwayland.cpp;h=2bae9e8996606f3e1cc5adbb9259a9a2b6712ff4;hb=dc465727c14a7d7588dad8554afc08f55e769b76;hp=098ee478fcfe652f40ca687299f4a558b9949ab9;hpb=331b84526ada3d98d207ae3ddcc4892b2868870f;p=staging%2Fwindowmanager.git diff --git a/src/wayland.cpp b/src/wayland.cpp index 098ee47..2bae9e8 100644 --- a/src/wayland.cpp +++ b/src/wayland.cpp @@ -22,7 +22,7 @@ display::display() logdebug("wl::display ~display @ %p", d); wl_display_disconnect(d); })), - r(!d ? nullptr : std::make_unique(d.get())) {} + r(d.get()) {} display::~display() {} @@ -74,9 +74,8 @@ void registry::global(uint32_t name, char const *iface, uint32_t v) { auto b = this->bindings.find(iface); if (b != this->bindings.end()) b->second(this->proxy, name, v); - else - logdebug("wl::registry @ %p global n %u i %s v %u", this->proxy, name, - iface, v); + logdebug("wl::registry @ %p global n %u i %s v %u", this->proxy, name, iface, + v); } void registry::global_remove(uint32_t name) {} @@ -228,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(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, @@ -310,7 +319,13 @@ 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) { + controlled_entity(c, i), + dst_rect{}, + src_rect{}, + size{}, + orientation{}, + visibility{}, + opacity{} { ivi_controller_layer_add_listener(this->proxy, &layer_listener, this); } @@ -513,19 +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) {