namespace wm
{
-const unsigned TIME_OUT = 1000000UL; /* 1s */
+const unsigned TIME_OUT = 10000000UL; /* 10s */
/* DrawingArea name used by "{layout}.{area}" */
const char kNameLayoutNormal[] = "normal";
}
}
+void App::removeClient(const std::string &appid){
+ HMI_DEBUG("wm", "Remove clinet %s from list", appid.c_str());
+ app_list.removeClient(appid);
+}
+
/**
* App Impl
*/
{
// firsttime set into sd_event
int ret = sd_event_add_time(afb_daemon_get_event_loop(), &timer_ev_src,
- CLOCK_REALTIME, time(NULL) * (1000000UL) + TIME_OUT, 0, processTimerHandler, this);
+ CLOCK_REALTIME, time(NULL) * (1000000UL) + TIME_OUT, 1, processTimerHandler, this);
if (ret < 0)
{
HMI_ERROR("wm", "Could't set timer");
{
//auto const &surface_id = this->lookup_id(drawing_name);
unsigned req_num = app_list.currentSequenceNumber();
- auto const &surface_id = this->lookup_id(action.appid.c_str());
+ auto const &surface_id = this->lookup_id(action.role.c_str());
if (!surface_id)
{
HMI_SEQ_ERROR(req_num, "Surface does not exist");
if(!ret){
//this->emit_error(request_seq, 0 /*error_num*/, "error happens"); // test
}
- if (ret && sync_draw_happen){
+ else if (ret && sync_draw_happen){
this->set_timer();
}
+ else{
+ app_list.removeRequest(req_num); // HACK!!!
+ }
return ret;
}
{
HMI_DEBUG("wm", "surface_id is %u", surface_id);
- // We cannot normally deactivate the main_surface, so be explicit
- // about it:
- if (int(surface_id) == this->layers.main_surface)
- {
- this->deactivate_main_surface();
- }
- else
- {
- auto drawing_name = this->lookup_name(surface_id);
- if (drawing_name)
- {
- std::string appid = "";
- /* auto = lookUpClient(surface_id);
- appid = client->appID();
-
- */
- this->api_deactivate_surface(appid.c_str(), drawing_name->c_str(), [](const char *) {});
- }
- }
-
- this->id_alloc.remove_id(surface_id);
- this->layers.remove_surface(surface_id);
+ app_list.removeSurface(surface_id);
}
void App::emit_activated(char const *label)
// add client into the db
std::string appid_str(appid);
std::string role(drawing_name);
- app_list.addClient(appid_str, role);
+ //app_list.addClient(appid_str, role);
+ app_list.addClient(appid_str, *lid, id, role);
return Ok<int>(id);
}