aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-14 20:41:56 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-14 20:52:43 +0900
commit788789a6f310d5e907b4d74284ab3c9e91ae2b3f (patch)
tree67e80cc07821b9a4e59e950bd25b6f30b9b6574c
parent71e11e97c0f7da37cd34424ec25058a073ad085f (diff)
Fix setRole
Change-Id: If45fb7ab91146cd5e36a2d7c40d2e3533b3a84a1 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r--src/window_manager.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/window_manager.cpp b/src/window_manager.cpp
index 99967b3..acfdab2 100644
--- a/src/window_manager.cpp
+++ b/src/window_manager.cpp
@@ -296,13 +296,14 @@ bool WindowManager::api_set_role(char const *appid, char const *drawing_name)
this->rolenew2old[role] = s_role;
}
- for(auto itr = this->tmp_surface2app.begin();
- itr != this->tmp_surface2app.end() ; ++itr)
+ // for(auto itr = this->tmp_surface2app.begin();
+ // itr != this->tmp_surface2app.end() ; ++itr)
+ // {
+ for(auto& x : this->tmp_surface2app)
{
- // const auto& x : this->tmp_surface2app)
- if(itr->second.appid == s_appid)
+ if(x.second.appid == s_appid)
{
- unsigned surface = itr->first;
+ unsigned surface = x.first;
auto client = g_app_list.lookUpClient(s_appid);
client->addSurface(surface);
this->tmp_surface2app.erase(surface);
@@ -612,7 +613,7 @@ void WindowManager::surface_created(unsigned pid, unsigned surface_id)
unsigned ppid = 0;
if(!ifs.fail() && std::getline(ifs, str))
{
- std::sscanf(str.data(), "%*d %*s %*c %*d %d", &ppid);
+ std::sscanf(str.data(), "%*d %*s %*c %d", &ppid);
HMI_INFO("Retrieve ppid %d", ppid);
}
else
@@ -662,8 +663,14 @@ void WindowManager::surface_created(unsigned pid, unsigned surface_id)
client->addSurface(surface_id);
this->id_alloc.register_name_id(client->role(), surface_id);
}
- struct TmpClient tmp_cl = {appid, ppid};
- this->tmp_surface2app[surface_id] = tmp_cl; /* Store for requestSurfaceXDG */
+ else
+ {
+ /*
+ * Store tmp surface and appid for application
+ * who requests setRole after creating shell surface
+ */
+ this->tmp_surface2app.emplace(surface_id, TmpClient{appid, ppid});
+ }
}
}