diff options
Diffstat (limited to 'src/app.cpp')
-rw-r--r-- | src/app.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/app.cpp b/src/app.cpp index 4ec4059..7462c99 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -829,32 +829,22 @@ void App::process_request() void App::api_enddraw(char const *appid, char const *drawing_name) { std::string id(appid); - unsigned request_seq = app_list.lookUpAllocatingApp(id); + std::string role(drawing_name); unsigned current_seq = app_list.currentSequenceNumber(); - if (current_seq != request_seq) + bool result = app_list.setEndDrawFinished(current_seq, id, role); + if (!result) { - if (request_seq == 0) - { - HMI_ERROR("wm", "You don't have Window Resource"); - } - else - { - HMI_ERROR("wm", "unknown error. Application may not obey the sequence manner. please call endDraw after syncDraw"); - } + HMI_ERROR("wm", "%s doesn't have Window Resource", id.c_str()); return; } - std::string role = drawing_name; - //std::string area = drawing_area; - app_list.setEndDrawFinished(request_seq, role); - - if (app_list.endDrawFullfilled(request_seq)) + if (app_list.endDrawFullfilled(current_seq)) { // do task for endDraw - this->do_enddraw(request_seq); - app_list.removeRequest(request_seq); - HMI_SEQ_INFO(request_seq, "Finish sequence"); - app_list.setCurrentSequence(request_seq + 1); + this->do_enddraw(current_seq); + app_list.removeRequest(current_seq); + HMI_SEQ_INFO(current_seq, "Finish sequence"); + app_list.next(); if (app_list.haveRequest()) { this->process_request(); @@ -862,7 +852,7 @@ void App::api_enddraw(char const *appid, char const *drawing_name) } else { - HMI_SEQ_INFO(request_seq, "Wait other App call endDraw"); + HMI_SEQ_INFO(current_seq, "Wait other App call endDraw"); return; } for (unsigned i = 0, iend = this->pending_end_draw.size(); i < iend; i++) |