diff options
-rw-r--r-- | src/window_manager.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
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; |