diff options
-rw-r--r-- | src/window_manager.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/window_manager.cpp b/src/window_manager.cpp index bba7531..0eebbff 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -716,18 +716,34 @@ void WindowManager::surface_properties(unsigned surface_id, unsigned pid) json_object *response; afb_service_call_sync("afm-main", "runners", nullptr, &response); - // pick up appid from pid from application manager - std::string appid; + // retrieve appid from pid from application manager + std::string appid = ""; if(response == nullptr) { HMI_ERROR("wm", "No runners"); } else { + // check appid then add it to the client HMI_INFO("wm", "Runners:%s", json_object_get_string(response)); + int size = json_object_array_length(response); + for(int i = 0; i < size; i++) + { + json_object *j = json_object_array_get_idx(response, i); + const char* id = jh::getStringFromJson(j, "id"); + int runid = jh::getIntFromJson(j, "runid"); + if(id && (runid > 0)) + { + if(runid == pid) + { + appid = id; + break; + } + } + } } + json_object_put(response); - // check appid then add it to the client g_app_list.addFloatingSurface(appid, surface_id, pid); } |