aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-05-31 19:18:33 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-05-31 19:18:33 +0900
commitf985291576affb4a2054e81ed34e7ff57ea50922 (patch)
tree8d7c4e584e9166ab8696341677ce8cd262f42322 /src
parent2e78bcd71f27bc18033b24d45bc3a67b5207862b (diff)
Modify app
* remove surface from app when surface is destroyed * add new function for removing client Change-Id: Iefef531ce1bc4a06ee0585ee35906ade86d452dc Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/app.cpp31
-rw-r--r--src/app.hpp1
2 files changed, 9 insertions, 23 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 336a986..00f391a 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -134,6 +134,11 @@ void App::timerHandler()
}
}
+void App::removeClient(const std::string &appid){
+ HMI_DEBUG("wm", "Remove clinet %s from list", appid.c_str());
+ app_list.removeClient(appid);
+}
+
/**
* App Impl
*/
@@ -1097,28 +1102,7 @@ void App::surface_removed(uint32_t surface_id)
{
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)
@@ -1187,7 +1171,8 @@ result<int> App::api_request_surface(char const *appid, char const *drawing_name
// 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);
}
diff --git a/src/app.hpp b/src/app.hpp
index 42758c9..7782e04 100644
--- a/src/app.hpp
+++ b/src/app.hpp
@@ -232,6 +232,7 @@ struct App
// Do not use this function
//static int processTimerHandler(sd_event_source *s, uint64_t usec, void *userdata);
void timerHandler();
+ void removeClient(const std::string &appid);
private:
optional<int> lookup_id(char const *name);