From ec78c651f425206c46b543786af0793033a41640 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Mon, 16 Jul 2018 16:38:43 +0900 Subject: Forgot to add code of set_role_pid_ver Change-Id: I94b9c290abdd5a531ef0f7956b4e79d1e76409d7 Signed-off-by: Kazumasa Mitsunari --- src/window_manager.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/window_manager.cpp b/src/window_manager.cpp index 1cee825..17be0f6 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -445,10 +445,26 @@ void WindowManager::api_activate_surface(char const *appid, char const *drawing_ // TODO: application requests by old role, // so convert role old to new const char *c_role = this->convertRoleOldToNew(drawing_name); - std::string id = appid; std::string role = c_role; std::string area = drawing_area; + + if(!g_app_list.contains(id)) + { + reply("app doesn't request 'requestSurface' or 'setRole' yet"); + return; + } + auto client = g_app_list.lookUpClient(id); + + unsigned srfc = client->surfaceID(role); + if(srfc == 0) + { + HMI_ERROR("wm", "role sould be set with surface"); + reply("role sould be set with surface"); + return; + } + g_app_list.removeFloatingSurface(client->surfaceID(role)); + Task task = Task::TASK_ALLOCATE; unsigned req_num = 0; WMError ret = WMError::UNKNOWN; -- cgit 1.2.3-korg