X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwindow_manager.cpp;h=7fc47c3e141b6f5caebd243701ef121340304dac;hb=04be11d71be97fe91591cee18077bd244788a7a0;hp=1e3a926725352989404a11af6097585b9b871bff;hpb=464f20cc2a960052233c4e2cbc2bd7dd3876b7f7;p=apps%2Fagl-service-windowmanager.git diff --git a/src/window_manager.cpp b/src/window_manager.cpp index 1e3a926..7fc47c3 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2017 TOYOTA MOTOR CORPORATION + * Copyright (c) 2019 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -167,7 +168,7 @@ result WindowManager::api_request_surface(char const *appid, char const *dr if(!g_app_list.contains(str_id)) { - unsigned lid = this->generateLayerForClient(role); + lid = this->generateLayerForClient(role); if (lid == 0) { return Err("Designated role does not match any role, fallback is disabled"); @@ -492,6 +493,7 @@ bool WindowManager::api_subscribe(afb_req_t req, EventType event_id) if(event_id < Event_Val_Min || event_id > Event_Val_Max) { HMI_ERROR("not defined in Window Manager", event_id); + free(appid); return ret; } HMI_INFO("%s subscribe %s : %d", appid, kListEventName[event_id].c_str(), event_id); @@ -508,17 +510,17 @@ bool WindowManager::api_subscribe(afb_req_t req, EventType event_id) else if(appid) { string id = appid; - free(appid); if(!g_app_list.contains(id)) { g_app_list.addClient(id); } - g_app_list.lookUpClient(id)->subscribe(req, kListEventName[event_id]); + ret = g_app_list.lookUpClient(id)->subscribe(req, kListEventName[event_id]); } else { HMI_ERROR("appid is not set"); } + free(appid); return ret; } @@ -713,7 +715,8 @@ void WindowManager::processError(WMError error) unsigned WindowManager::generateLayerForClient(const string& role) { - unsigned lid = this->lc->getNewLayerID(role); + string l_name; + unsigned lid = this->lc->getNewLayerID(role, &l_name); if (lid == 0) { // register drawing_name as fallback and make it displayed. @@ -724,7 +727,10 @@ unsigned WindowManager::generateLayerForClient(const string& role) return lid; } } - this->lc->createNewLayer(lid); + + // TODO: remote layer name is fixed + this->lc->createNewLayer(lid, ("Remote" == l_name)); + // add client into the db return lid; }