summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-12 11:29:39 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-12 11:29:39 +0200
commit9b397b09fe6eef8936ad41763e4908e99ce274d6 (patch)
tree0dc45f00399270b4fe30a5c8fc5289c086b33bae
parentb02a0011c13e4945ec97eef1efad13b3a87c6016 (diff)
App: be more thorough on (de)activate()
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r--src/app.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 3085c61..4feeb03 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -678,7 +678,8 @@ result<int> App::api_request_surface(char const *drawing_name) {
}
void App::activate(int id) {
- if (this->controller->sprops[id].visibility == 0) {
+ auto ip = this->controller->sprops.find(id);
+ if (ip != this->controller->sprops.end() && ip->second.visibility == 0) {
this->controller->surfaces[id]->set_visibility(1);
char const *label =
this->lookup_name(id).value_or("unknown-name").c_str();
@@ -688,7 +689,8 @@ void App::activate(int id) {
}
void App::deactivate(int id) {
- if (this->controller->sprops[id].visibility != 0) {
+ auto ip = this->controller->sprops.find(id);
+ if (ip != this->controller->sprops.end() && ip->second.visibility != 0) {
this->controller->surfaces[id]->set_visibility(0);
char const *label =
this->lookup_name(id).value_or("unknown-name").c_str();