From: Marcus Fritzsch Date: Tue, 5 Sep 2017 10:10:40 +0000 (+0200) Subject: App: only activate/deactivate if necessary X-Git-Tag: 4.99.1~132 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=28ea1b5c23d2814e32ad133ba833d87f73522087;p=staging%2Fwindowmanager.git App: only activate/deactivate if necessary Signed-off-by: Marcus Fritzsch --- 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 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()); + } } // _ _ _ _ _ _ _