X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain.cpp;h=5de7e75a5eb5b03d29d54f42cbd084802802c084;hb=4c5fda5634649aec25d42ac1a9c95936d99b48ba;hp=014c72eb62016ce3486c42c66826065a8a5bf655;hpb=847dde9621cef9b9a44eda95c63c0fe3f528468d;p=apps%2Fagl-service-windowmanager-2017.git diff --git a/src/main.cpp b/src/main.cpp index 014c72e..5de7e75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -213,6 +213,7 @@ static void cbRemoveClientCtxt(void *data) g_afb_instance->app.controller->surfaces.erase(sid); HMI_DEBUG("wm", "delete surfaceID %d", sid); } + g_afb_instance->app.removeClient(ctxt->name); delete ctxt; } @@ -245,13 +246,14 @@ void windowmanager_requestsurface(afb_req req) noexcept HMI_DEBUG("wm", "You're %s.", ctxt->name.c_str()); if (ctxt->name != std::string(a_drawing_name)) { - afb_req_fail_f(req, "failed", "Don't request with other name: %s for now", a_drawing_name); + afb_req_fail_f(req, "failed", "Dont request with other name: %s for now", a_drawing_name); HMI_DEBUG("wm", "Don't request with other name: %s for now", a_drawing_name); return; } } - auto ret = g_afb_instance->app.api_request_surface(a_drawing_name); + auto ret = g_afb_instance->app.api_request_surface( + afb_req_get_application_id(req), a_drawing_name); if (isFirstReq) { @@ -312,7 +314,8 @@ void windowmanager_requestsurfacexdg(afb_req req) noexcept } char const *a_ivi_id = json_object_get_string(j_ivi_id); - auto ret = g_afb_instance->app.api_request_surface(a_drawing_name, a_ivi_id); + auto ret = g_afb_instance->app.api_request_surface( + afb_req_get_application_id(req), a_drawing_name, a_ivi_id); if (ret != nullptr) { afb_req_fail(req, "failed", ret); @@ -356,20 +359,23 @@ void windowmanager_activatesurface(afb_req req) noexcept return; } - g_afb_instance->app.api_activate_surface(a_drawing_name, a_drawing_area, - [&req](const char *errmsg) { - if (errmsg != nullptr) - { - HMI_ERROR("wm", errmsg); - afb_req_fail(req, "failed", errmsg); - return; - } - afb_req_success(req, NULL, "success"); - }); + g_afb_instance->app.api_activate_surface( + afb_req_get_application_id(req), + a_drawing_name, a_drawing_area, + [&req](const char *errmsg) { + if (errmsg != nullptr) + { + HMI_ERROR("wm", errmsg); + afb_req_fail(req, "failed", errmsg); + return; + } + afb_req_success(req, NULL, "success"); + }); } catch (std::exception &e) { - HMI_WARNING("wm", "failed", "Uncaught exception while calling activatesurface: %s", e.what()); + HMI_WARNING("wm", "failed: Uncaught exception while calling activatesurface: %s", e.what()); + g_afb_instance->app.exceptionProcessForTransition(); return; } } @@ -395,20 +401,22 @@ void windowmanager_deactivatesurface(afb_req req) noexcept return; } - g_afb_instance->app.api_deactivate_surface(a_drawing_name, - [&req](const char *errmsg) { - if (errmsg != nullptr) - { - HMI_ERROR("wm", errmsg); - afb_req_fail(req, "failed", errmsg); - return; - } - afb_req_success(req, NULL, "success"); - }); + g_afb_instance->app.api_deactivate_surface( + afb_req_get_application_id(req), a_drawing_name, + [&req](const char *errmsg) { + if (errmsg != nullptr) + { + HMI_ERROR("wm", errmsg); + afb_req_fail(req, "failed", errmsg); + return; + } + afb_req_success(req, NULL, "success"); + }); } catch (std::exception &e) { - HMI_WARNING("wm", "Uncaught exception while calling deactivatesurface: %s", e.what()); + HMI_WARNING("wm", "failed: Uncaught exception while calling deactivatesurface: %s", e.what()); + g_afb_instance->app.exceptionProcessForTransition(); return; } } @@ -435,11 +443,13 @@ void windowmanager_enddraw(afb_req req) noexcept } afb_req_success(req, NULL, "success"); - g_afb_instance->app.api_enddraw(a_drawing_name); + g_afb_instance->app.api_enddraw( + afb_req_get_application_id(req), a_drawing_name); } catch (std::exception &e) { - HMI_WARNING("wm", "failed", "Uncaught exception while calling enddraw: %s", e.what()); + HMI_WARNING("wm", "failed: Uncaught exception while calling enddraw: %s", e.what()); + g_afb_instance->app.exceptionProcessForTransition(); return; } }