diff options
Diffstat (limited to 'src/window_manager.cpp')
-rw-r--r-- | src/window_manager.cpp | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/src/window_manager.cpp b/src/window_manager.cpp index bb8b073..22f411a 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -136,7 +136,7 @@ WindowManager::WindowManager(wl::display *d) { lm_setting_path += "/etc/layers_setting.json"; } - this->lm = std::make_shared<LayoutManager>(lm_setting_path); + this->lm = std::make_shared<LayerControl>(lm_setting_path); /* try { @@ -249,12 +249,14 @@ result<int> WindowManager::api_request_surface(char const *appid, char const *dr const char *role = this->convertRoleOldToNew(drawing_name); auto lid = this->layers.get_layer_id(string(role)); - if (!lid) + unsigned l_id = this->lm->getNewLayerID(role); + if (l_id != 0) { /** * register drawing_name as fallback and make it displayed. */ lid = this->layers.get_layer_id(string("fallback")); + l_id = this->lm->getNewLayerID("fallback"); HMI_DEBUG("wm", "%s is not registered in layers.json, then fallback as normal app", role); if (!lid) { @@ -262,30 +264,41 @@ result<int> WindowManager::api_request_surface(char const *appid, char const *dr } } - auto rname = this->lookup_id(role); - if (!rname) - { + // generate surface ID for ivi-shell application + + // auto rname = this->lookup_id(role); + // if (!rname) + // { // name does not exist yet, allocate surface id... auto id = int(this->id_alloc.generate_id(role)); - this->layers.add_surface(id, *lid); + // this->layers.add_surface(id, *lid); // set the main_surface[_name] here and now - if (!this->layers.main_surface_name.empty() && - this->layers.main_surface_name == drawing_name) - { - this->layers.main_surface = id; - HMI_DEBUG("wm", "Set main_surface id to %u", id); - } + // if (!this->layers.main_surface_name.empty() && + // this->layers.main_surface_name == drawing_name) + // { + // this->layers.main_surface = id; + // HMI_DEBUG("wm", "Set main_surface id to %u", id); + // } // add client into the db string appid_str(appid); - g_app_list.addClient(appid_str, *lid, id, string(role)); + if(g_app_list.contains(appid_str)) + { + // add surface into app + auto client = g_app_list.lookUpClient(appid_str); + // client.addSurface(id); + } + else + { + g_app_list.addClient(appid_str, l_id, id, string(role)); + } // Set role map of (new, old) this->rolenew2old[role] = string(drawing_name); return Ok<int>(id); - } + // } // Check currently registered drawing names if it is already there. return Err<int>("Surface already present"); |