aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 47f18aa..6bb1a3e 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -746,6 +746,7 @@ void App::emitScreenUpdated(char const* appid) {
result<int> App::api_request_surface(char const *drawing_name) {
// Convert drawing_name to role
const char* role = this->convertDrawingNameToRole(drawing_name);
+
auto lid = this->layers.get_layer_id(std::string(role));
if (!lid) {
/**
@@ -787,8 +788,10 @@ result<int> App::api_request_surface(char const *drawing_name) {
char const *App::api_request_surface(char const *drawing_name,
char const *ivi_id) {
ST();
+ // Convert drawing_name to role
+ const char* role = this->convertDrawingNameToRole(drawing_name);
- auto lid = this->layers.get_layer_id(std::string(drawing_name));
+ auto lid = this->layers.get_layer_id(std::string(role));
unsigned sid = std::stol(ivi_id);
if (!lid) {
@@ -802,14 +805,14 @@ char const *App::api_request_surface(char const *drawing_name,
}
}
- auto rname = this->lookup_id(drawing_name);
+ auto rname = this->lookup_id(role);
if (rname) {
return "Surface already present";
}
// register pair drawing_name and ivi_id
- this->id_alloc.register_name_id(drawing_name, sid);
+ this->id_alloc.register_name_id(role, sid);
this->layers.add_surface(sid, *lid);
// this surface is already created