diff options
Diffstat (limited to 'src/app.cpp')
-rw-r--r-- | src/app.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/app.cpp b/src/app.cpp index 838908c..9efa34a 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -654,8 +654,14 @@ void App::emit_visible(char const *label) { return emit_visible(label, true); } result<int> App::api_request_surface(char const *drawing_name) { auto lid = this->layers.get_layer_id(std::string(drawing_name)); if (!lid) { - // TODO: Do we need to put these applications on the App layer? - return Err<int>("Drawing name does not match any role"); + /** + * register drawing_name as fallback and make it displayed. + */ + lid = this->layers.get_layer_id(std::string("Fallback")); + HMI_DEBUG("wm", "%s is not registered in layers.json, then fallback as normal app", drawing_name); + if(!lid){ + return Err<int>("Drawing name does not match any role, Fallback is disabled"); + } } auto rname = this->lookup_id(drawing_name); @@ -686,7 +692,14 @@ char const *App::api_request_surface(char const *drawing_name, unsigned sid = std::stol(ivi_id); if (!lid) { - return "Drawing name does not match any role"; + /** + * register drawing_name as fallback and make it displayed. + */ + lid = this->layers.get_layer_id(std::string("Fallback")); + HMI_DEBUG("wm", "%s is not registered in layers.json, then fallback as normal app", drawing_name); + if(!lid){ + return "Drawing name does not match any role, Fallback is disabled"; + } } auto rname = this->lookup_id(drawing_name); |