X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwindow_manager.cpp;h=7c9da243313d271951754c6a3d428baa015a0105;hb=93c0b6297958854978b616dd6df3e4b118c67ba2;hp=a924ab56189d1138c677d32f8efa3dba764bd7fd;hpb=1b1051702003391f958f4bf68c5dfe88676d56d4;p=apps%2Fagl-service-windowmanager.git diff --git a/src/window_manager.cpp b/src/window_manager.cpp index a924ab5..7c9da24 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -292,6 +292,8 @@ result WindowManager::api_request_surface(char const *appid, char const *dr { // name does not exist yet, allocate surface id... auto id = int(this->id_alloc.generate_id(role)); + this->tmp_surface2app[id] = s_appid; + // this->layers.add_surface(id, *lid); // set the main_surface[_name] here and now @@ -731,7 +733,25 @@ void WindowManager::send_event(char const *evname, char const *label, char const */ void WindowManager::surface_created(uint32_t surface_id) { - HMI_DEBUG("current : %d", surface_id); + if(this->tmp_surface2app.count(surface_id) != 0) + { + string appid = this->tmp_surface2app[surface_id]; + this->tmp_surface2app.erase(surface_id); + if(g_app_list.contains(appid)) + { + auto client = g_app_list.lookUpClient(appid); + WMError ret = client->addSurface(surface_id); + HMI_INFO("Add surface %d to \"%s\"", appid.c_str()); + if(ret != WMError::SUCCESS) + { + HMI_ERROR("Failed to add surface to client %s", client->appID().c_str()); + } + } + } + else + { + HMI_NOTICE("Unknown surface %d", surface_id); + } /* this->controller->get_surface_properties(surface_id, IVI_WM_PARAM_SIZE); auto layer_id = this->layers.get_layer_id(surface_id); @@ -845,7 +865,7 @@ void WindowManager::startTransitionWrapper(vector &actions) { bool found; auto const &surface_id = this->id_alloc.lookup(act.role); - string appid = g_app_list.getAppID(*surface_id, act.role, &found); + string appid = g_app_list.getAppID(*surface_id, &found); if (!found) { if (TaskVisible::INVISIBLE == act.visible)