X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapp.cpp;h=307217e98850bf0d952362606d489d704ea0353f;hb=9f9abc58011121722a82759124d061a645cee112;hp=ba258b5bed8844b902f10d7c8c66efd4bb37f2ad;hpb=afd5c59cdfeeb142feb57afe7d3d47f5f83fda45;p=apps%2Fagl-service-windowmanager.git diff --git a/src/app.cpp b/src/app.cpp index ba258b5..307217e 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -44,12 +44,16 @@ namespace { using nlohmann::json; result file_to_json(char const *filename) { + json j; std::ifstream i(filename); if (i.fail()) { - return Err("Could not open config file"); + HMI_DEBUG("wm", "Could not open config file, so use default layer information"); + j = default_layers_json; } - json j; - i >> j; + else { + i >> j; + } + return Ok(j); } @@ -500,8 +504,7 @@ char const *App::api_deactivate_surface(char const *drawing_name) { return "No surface active"; } - // XXX: check against main_surface, main_surface_name is the configuration - // item. + // Check against main_surface, main_surface_name is the configuration item. if (*surface_id == this->layers.main_surface) { HMI_DEBUG("wm", "Refusing to deactivate main_surface %d", *surface_id); return nullptr; @@ -576,7 +579,6 @@ char const *App::api_enddraw(char const *drawing_name) { if (n && *n == drawing_name) { std::swap(this->pending_end_draw[i], this->pending_end_draw[iend - 1]); this->pending_end_draw.resize(iend - 1); - // XXX: Please tell the compositor to thaw the surface... this->activate(this->pending_end_draw[i]); this->layout_commit(); this->emit_flushdraw(drawing_name);