summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-05 12:10:40 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-05 12:13:31 +0200
commit28ea1b5c23d2814e32ad133ba833d87f73522087 (patch)
tree6aac7d7a95d1a8e5cade7f63e2af3dcf96a055b3 /src
parent182aa777f3ef9a2e82d2436a222dfe7dc9f79178 (diff)
App: only activate/deactivate if necessary
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/app.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/app.cpp b/src/app.cpp
index a59adba..26dc5f6 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -491,13 +491,19 @@ result<int> App::request_surface(char const *drawing_name) {
}
void App::activate(unsigned id) {
- this->controller->surfaces[id]->set_visibility(1);
- this->emit_activated(this->lookup_name(id).value_or("unknown-name").c_str());
+ if (this->controller->sprops[id].visibility == 0) {
+ this->controller->surfaces[id]->set_visibility(1);
+ this->emit_activated(
+ this->lookup_name(id).value_or("unknown-name").c_str());
+ }
}
void App::deactivate(unsigned id) {
- this->controller->surfaces[id]->set_visibility(0);
- this->emit_deactivated(this->lookup_name(id).value_or("unknown-name").c_str());
+ if (this->controller->sprops[id].visibility != 0) {
+ this->controller->surfaces[id]->set_visibility(0);
+ this->emit_deactivated(
+ this->lookup_name(id).value_or("unknown-name").c_str());
+ }
}
// _ _ _ _ _ _ _