X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapp.cpp;h=4feeb03056b2aacac0de9de17a7634d56720fa6a;hb=9b397b09fe6eef8936ad41763e4908e99ce274d6;hp=80637a46efed1a02dfbdb30d7e0723dc69992efb;hpb=19609464e573625fb82e55aa7e92d43d44f0b825;p=staging%2Fwindowmanager.git diff --git a/src/app.cpp b/src/app.cpp index 80637a4..4feeb03 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -426,7 +426,6 @@ char const *App::api_activate_surface(char const *drawing_name) { } else { bool can_split = this->can_split(state, *surface_id); - if (state.sub == -1) { if (can_split) { this->try_layout( state, @@ -437,6 +436,9 @@ char const *App::api_activate_surface(char const *drawing_name) { this->surface_set_layout(state.main, surface_id); this->activate(*surface_id); + if (state.sub != -1) { + this->deactivate(state.sub); + } state = nl; this->layout_commit(); @@ -451,7 +453,9 @@ char const *App::api_activate_surface(char const *drawing_name) { this->surface_set_layout(*surface_id); this->deactivate(state.main); this->activate(*surface_id); - this->deactivate(state.sub); + if (state.sub != -1) { + this->deactivate(state.sub); + } state = nl; this->layout_commit(); @@ -459,7 +463,6 @@ char const *App::api_activate_surface(char const *drawing_name) { this->enqueue_flushdraw(state.main); }); } - } } // no error @@ -675,7 +678,8 @@ result 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(); @@ -685,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();