Forgot to add code of set_role_pid_ver
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Mon, 16 Jul 2018 07:38:43 +0000 (16:38 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Mon, 16 Jul 2018 07:38:43 +0000 (16:38 +0900)
Change-Id: I94b9c290abdd5a531ef0f7956b4e79d1e76409d7
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
src/window_manager.cpp

index 1cee825..17be0f6 100644 (file)
@@ -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;