summaryrefslogtreecommitdiffstats
path: root/src/applist.cpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-10-22 09:30:19 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-11-13 13:05:39 +0900
commit010ca3f3459a52e44deb5e70e94e9cd394814e3e (patch)
tree96b8cc678180df86c95f362049dc40e7ce09833b /src/applist.cpp
parentc2110a3ec8fa74f2fc37e4909db547aa4a36c851 (diff)
Attach application to ivi-layer not to surface
Window Manager expresses the application in ivi-layer. So for, Window Manager tied the surface and role applied by the application. This patch associates the application with the ivi-layer, and the role and surface are the attributes that makes up the application. Bug-AGL: SPEC-1818, SPEC-1635 Change-Id: Ice1e398e1db037577b0721c16da6603ec5437561 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/applist.cpp')
-rw-r--r--src/applist.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/applist.cpp b/src/applist.cpp
index 79df62c..17b47e3 100644
--- a/src/applist.cpp
+++ b/src/applist.cpp
@@ -73,6 +73,14 @@ void AppList::addClient(const string &appid, unsigned layer, unsigned surface, c
this->clientDump();
}
+void AppList::addClient(const string &appid, unsigned layer, const string &role)
+{
+ std::lock_guard<std::mutex> lock(this->mtx);
+ shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, layer, role);
+ this->app2client[appid] = client;
+ this->clientDump();
+}
+
/**
* Remove WMClient from the list
*
@@ -132,7 +140,14 @@ void AppList::removeSurface(unsigned surface){
*/
shared_ptr<WMClient> AppList::lookUpClient(const string &appid)
{
- return this->app2client.at(appid);
+ if(this->app2client.count(appid) != 0)
+ {
+ return this->app2client.at(appid);
+ }
+ else
+ {
+ return nullptr;
+ }
}
/**
@@ -154,17 +169,16 @@ int AppList::countClient() const
* Returns AppID if found.
*
* @param unsigned[in] surfaceID
- * @param string[in] role
* @param bool[in,out] AppID is found or not
* @return AppID
* @attention If AppID is not found, param found will be false.
*/
-string AppList::getAppID(unsigned surface, const string& role, bool* found) const
+string AppList::getAppID(unsigned surface, bool* found) const
{
*found = false;
for (const auto &x : this->app2client)
{
- if(x.second->surfaceID(role) == surface){
+ if(x.second->surfaceID() == surface){
*found = true;
return x.second->appID();
}