X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapp.cpp;h=8ff0c17cdf57102187de40f1c9b8a5ac53824352;hb=6aad766f32dcfcb81b0006248852845778d179a8;hp=f509be0dd129fbf9581e5bdd1a63401bf5485693;hpb=0f8ae2ce27e185fb37cf6bdde6644807c32abf73;p=apps%2Fagl-service-windowmanager.git diff --git a/src/app.cpp b/src/app.cpp index f509be0..8ff0c17 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -160,17 +160,26 @@ App::App(wl::display *d) display{d}, controller{}, outputs(), - config(), layers(), id_alloc{}, - pending_events(false), - policy{} + pending_events(false) { + char const *path_layers_json = getenv("AFM_APP_INSTALL_DIR"); + std::string path; + if (!path_layers_json) + { + HMI_ERROR("wm", "AFM_APP_INSTALL_DIR is not defined"); + path = std::string(path_layers_json); + } + else + { + path = std::string(path_layers_json) + std::string("/etc/layers.json"); + } + try { { - auto l = load_layer_map( - this->config.get_string("layers.json").value().c_str()); + auto l = load_layer_map(path.c_str()); if (l.is_ok()) { this->layers = l.unwrap(); @@ -1177,19 +1186,6 @@ void App::surface_created(uint32_t surface_id) this->controller->layers[*layer_id]->add_surface(surface_id); this->layout_commit(); - // activate the main_surface right away - /*if (surface_id == static_cast(this->layers.main_surface)) { - HMI_DEBUG("wm", "Activating main_surface (%d)", surface_id); - - this->api_activate_surface( - this->lookup_name(surface_id).value_or("unknown-name").c_str()); - }*/ - - // search pid from surfaceID - - // pick up appid from pid from application manager - - // check appid then add it to the client } void App::surface_removed(uint32_t surface_id)