Remove pid in args in setRole
[apps/agl-service-windowmanager.git] / src / main.cpp
index 6b4fef6..b0c9415 100644 (file)
@@ -223,7 +223,6 @@ void windowmanager_setrole(afb_req req) noexcept
     }
     try
     {
-        unsigned pid = 0;
         char const *appid = afb_req_get_application_id(req);
         json_object *jreq = afb_req_json(req);
 
@@ -235,15 +234,7 @@ void windowmanager_setrole(afb_req req) noexcept
         }
         char const *a_role = json_object_get_string(j_role);
 
-        json_object *j_pid = nullptr;
-        if (json_object_object_get_ex(jreq, "pid", &j_pid))
-        {
-            HMI_DEBUG("PID is set");
-            char const *a_pid = json_object_get_string(j_pid);
-            pid = std::stol(a_pid);
-        }
-
-        auto ret = g_afb_instance->wmgr.api_set_role(appid, a_role, pid);
+        auto ret = g_afb_instance->wmgr.api_set_role(appid, a_role);
         if (!ret)
         {
             afb_req_fail(req, "failed", "Couldn't register");
@@ -520,19 +511,10 @@ void windowmanager_ping(afb_req req) noexcept
         afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
         return;
     }
-
-    try
+    else
     {
-
-        g_afb_instance->wmgr.api_ping();
-
         afb_req_success(req, NULL, "success");
     }
-    catch (std::exception &e)
-    {
-        afb_req_fail_f(req, "failed", "Uncaught exception while calling ping: %s", e.what());
-        return;
-    }
 }
 
 void windowmanager_debug_status(afb_req req) noexcept
@@ -643,14 +625,14 @@ void windowmanager_debug_terminate(afb_req req) noexcept
 }
 
 const struct afb_verb_v2 windowmanager_verbs[] = {
-    {"requestsurface", windowmanager_requestsurface, nullptr, nullptr, AFB_SESSION_NONE},
-    {"requestsurfacexdg", windowmanager_requestsurfacexdg, nullptr, nullptr, AFB_SESSION_NONE},
-    {"setrole", windowmanager_setrole, nullptr, nullptr, AFB_SESSION_NONE},
-    {"activatewindow", windowmanager_activatewindow, nullptr, nullptr, AFB_SESSION_NONE},
-    {"deactivatewindow", windowmanager_deactivatewindow, nullptr, nullptr, AFB_SESSION_NONE},
-    {"enddraw", windowmanager_enddraw, nullptr, nullptr, AFB_SESSION_NONE},
-    {"getdisplayinfo", windowmanager_getdisplayinfo_thunk, nullptr, nullptr, AFB_SESSION_NONE},
-    {"getareainfo", windowmanager_getareainfo_thunk, nullptr, nullptr, AFB_SESSION_NONE},
+    {"requestSurface", windowmanager_requestsurface, nullptr, nullptr, AFB_SESSION_NONE},
+    {"requestSurfaceXdg", windowmanager_requestsurfacexdg, nullptr, nullptr, AFB_SESSION_NONE},
+    {"setRole", windowmanager_setrole, nullptr, nullptr, AFB_SESSION_NONE},
+    {"activateWindow", windowmanager_activatewindow, nullptr, nullptr, AFB_SESSION_NONE},
+    {"deactivateWindow", windowmanager_deactivatewindow, nullptr, nullptr, AFB_SESSION_NONE},
+    {"endDraw", windowmanager_enddraw, nullptr, nullptr, AFB_SESSION_NONE},
+    {"getDisplayInfo", windowmanager_getdisplayinfo_thunk, nullptr, nullptr, AFB_SESSION_NONE},
+    {"getAreaInfo", windowmanager_getareainfo_thunk, nullptr, nullptr, AFB_SESSION_NONE},
     {"wm_subscribe", windowmanager_wm_subscribe, nullptr, nullptr, AFB_SESSION_NONE},
     {"list_drawing_names", windowmanager_list_drawing_names, nullptr, nullptr, AFB_SESSION_NONE},
     {"ping", windowmanager_ping, nullptr, nullptr, AFB_SESSION_NONE},