summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,