Change wmClientContext
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Thu, 31 May 2018 15:02:22 +0000 (00:02 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Thu, 31 May 2018 15:02:22 +0000 (00:02 +0900)
Change-Id: I1fca8d68a20e2bb6a6efc6d70b4ec9a762d523c9
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
src/main.cpp

index 60f8164..ef07e26 100644 (file)
@@ -34,9 +34,11 @@ extern "C"
 typedef struct wmClientCtxt
 {
     std::string name;
-    wmClientCtxt(const char *appName)
+    std::string role;
+    wmClientCtxt(const char *appName, const char* appRole)
     {
         name = appName;
+        role = role;
     }
 } wmClientCtxt;
 
@@ -191,7 +193,7 @@ static void cbRemoveClientCtxt(void *data)
     }
     HMI_DEBUG("wm", "remove app %s", ctxt->name.c_str());
     // Lookup surfaceID and remove it because App is dead.
-    auto pSid = g_afb_instance->app.id_alloc.lookup(ctxt->name.c_str());
+    auto pSid = g_afb_instance->app.id_alloc.lookup(ctxt->role.c_str());
     if (pSid)
     {
         auto sid = *pSid;
@@ -245,7 +247,7 @@ void windowmanager_requestsurface(afb_req req) noexcept
 
         if (isFirstReq)
         {
-            wmClientCtxt *ctxt = new wmClientCtxt(a_drawing_name);
+            wmClientCtxt *ctxt = new wmClientCtxt(afb_req_get_application_id(req), a_drawing_name);
             HMI_DEBUG("wm", "create session for %s", ctxt->name.c_str());
             afb_req_session_set_LOA(req, 1);
             afb_req_context_set(req, ctxt, cbRemoveClientCtxt);