Change local variable name
[apps/agl-service-windowmanager.git] / src / window_manager.cpp
index a924ab5..6b2ecf9 100644 (file)
@@ -292,6 +292,8 @@ result<int> WindowManager::api_request_surface(char const *appid, char const *dr
     {
         // name does not exist yet, allocate surface id...
         auto id = int(this->id_alloc.generate_id(role));
+        this->tmp_surface2app[id] = s_appid;
+
         // this->layers.add_surface(id, *lid);
 
         // set the main_surface[_name] here and now
@@ -732,6 +734,17 @@ void WindowManager::send_event(char const *evname, char const *label, char const
 void WindowManager::surface_created(uint32_t surface_id)
 {
     HMI_DEBUG("current : %d", surface_id);
+    if(this->tmp_surface2app.count(surface_id) != 0)
+    {
+        string appid = this->tmp_surface2app[surface_id];
+        this->tmp_surface2app.erase(surface_id);
+        auto client = g_app_list.lookUpClient(appid);
+        bool ret = client->addSurface(surface_id);
+        if(!ret)
+        {
+            HMI_ERROR("Failed to add surface to client %s", client->appID().c_str());
+        }
+    }
     /* this->controller->get_surface_properties(surface_id, IVI_WM_PARAM_SIZE);
 
     auto layer_id = this->layers.get_layer_id(surface_id);
@@ -845,7 +858,7 @@ void WindowManager::startTransitionWrapper(vector<WMAction> &actions)
         {
             bool found;
             auto const &surface_id = this->id_alloc.lookup(act.role);
-            string appid = g_app_list.getAppID(*surface_id, act.role, &found);
+            string appid = g_app_list.getAppID(*surface_id, &found);
             if (!found)
             {
                 if (TaskVisible::INVISIBLE == act.visible)