summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-30 14:46:01 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-04 16:54:00 +0200
commite8a9ad4aa03e55d9b218822fe575fdc6ae97bac8 (patch)
tree5beb4cc4afe3966ff36edd9699add359832271ba /src
parente30e5c0f8d3c118ac4e8120dd48cc76954b0a940 (diff)
wayland: only create layers and surfaces when necessary
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/wayland.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/wayland.cpp b/src/wayland.cpp
index 01ac275..df601eb 100644
--- a/src/wayland.cpp
+++ b/src/wayland.cpp
@@ -234,15 +234,21 @@ void controller::controller_screen(uint32_t id,
void controller::controller_layer(uint32_t id) {
logdebug("genivi::controller @ %p layer %u (%x)", this->proxy.get(), id, id);
- auto &l = this->layers[id] = std::make_unique<struct layer>(id, this);
- l->clear_surfaces();
+ if (this->layers.find(id) != this->layers.end()) {
+ logerror("Someone created a layer without asking US! (%d)", id);
+ } else {
+ auto &l = this->layers[id] = std::make_unique<struct layer>(id, this);
+ l->clear_surfaces();
+ }
}
void controller::controller_surface(uint32_t id) {
logdebug("genivi::controller @ %p surface %u (%x)", this->proxy.get(), id,
id);
- this->surfaces[id] = std::make_unique<struct surface>(id, this);
- this->chooks->surface_created(id);
+ if (this->surfaces.find(id) == this->surfaces.end()) {
+ this->surfaces[id] = std::make_unique<struct surface>(id, this);
+ this->chooks->surface_created(id);
+ }
}
void controller::controller_error(int32_t object_id, int32_t object_type,