aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-14 18:51:33 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-14 19:09:57 +0900
commit4d67209654fe8de3407b513800471fc48c4865fc (patch)
treeb7f31f4a23c01478ad2147b76ca95308d90a21c1
parent3bb2a22cfda22c2a7ad2e9d9d6266f116b0cf12a (diff)
Fix requestSurfaceXDG
Change-Id: Ieb3d46e03e6b7894cb3175ee5c48a725f86c3426 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r--src/window_manager.cpp32
-rw-r--r--src/wm_layer_control.cpp15
-rw-r--r--src/wm_layer_control.hpp1
3 files changed, 32 insertions, 16 deletions
diff --git a/src/window_manager.cpp b/src/window_manager.cpp
index 4efae89..4db577d 100644
--- a/src/window_manager.cpp
+++ b/src/window_manager.cpp
@@ -198,6 +198,22 @@ result<int> WindowManager::api_request_surface(char const *appid, char const *dr
char const *WindowManager::api_request_surface(char const *appid, char const *drawing_name,
char const *ivi_id)
{
+ unsigned sid = std::stol(ivi_id);
+
+ HMI_DEBUG("This API(requestSurfaceXDG) is for XDG Application using runXDG");
+ /*
+ * IVI-shell doesn't send surface_size event via ivi-wm protocol
+ * if the application is using XDG surface.
+ * So WM has to set surface size with original size here
+ */
+ WMError ret = this->lc->setXDGSurfaceOriginSize(sid);
+ if(ret != SUCCESS)
+ {
+ HMI_ERROR("%s", errorDescription(ret));
+ HMI_WARNING("The main user of this API is runXDG");
+ return "fail";
+ }
+
// TODO: application requests by old role,
// so convert role old to new
const char *role = this->convertRoleOldToNew(drawing_name);
@@ -226,31 +242,15 @@ char const *WindowManager::api_request_surface(char const *appid, char const *dr
g_app_list.addClient(s_appid, l_id, s_role);
}
- unsigned sid = std::stol(ivi_id);
-
auto rname = this->id_alloc.lookup(s_role);
if (rname)
{
return "Surface already present";
}
- if(this->tmp_surface2app.count(sid) != 0)
- {
- this->tmp_surface2app.erase(sid);
- }
-
// register pair drawing_name and ivi_id
this->id_alloc.register_name_id(role, sid);
- // this->layers.add_surface(sid, *lid);
-
- // this surface is already created
- // HMI_DEBUG("surface_id is %u, layer_id is %u", sid, *lid);
-
- // this->controller->layers[*lid]->add_surface(sid);
- // this->layout_commit();
- // add client into the db
- // g_app_list.addClient(appid_str, lid, s_role);
auto client = g_app_list.lookUpClient(s_appid);
client->addSurface(sid);
diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp
index 0028fca..cf82a6b 100644
--- a/src/wm_layer_control.cpp
+++ b/src/wm_layer_control.cpp
@@ -258,6 +258,21 @@ WMError LayerControl::renderLayers()
return rc;
}
+WMError LayerControl::setXDGSurfaceOriginSize(unsigned surface)
+{
+ WMError ret = WMError::NOT_REGISTERED;
+ ilmSurfaceProperties prop;
+ ilmErrorTypes rc = ilm_getPropertiesOfSurface(surface, &prop);
+ if(rc == ILM_SUCCESS)
+ {
+ HMI_INFO("xdg surface info %d, %d", prop.origSourceWidth, prop.origSourceHeight);
+ ilm_surfaceSetSourceRectangle(surface, 0, 0, prop.origSourceWidth, prop.origSourceHeight);
+ ret = WMError::SUCCESS;
+ }
+ return ret;
+}
+
+
void LayerControl::undoUpdate()
{
for(auto& l : this->wm_layers)
diff --git a/src/wm_layer_control.hpp b/src/wm_layer_control.hpp
index 7a283b9..5f336af 100644
--- a/src/wm_layer_control.hpp
+++ b/src/wm_layer_control.hpp
@@ -76,6 +76,7 @@ class LayerControl
// std::vector<unsigned> getRenderOrder(const std::string& layer_name);
WMError updateLayer(LayerState& layer_state);
WMError renderLayers();
+ WMError setXDGSurfaceOriginSize(unsigned surface);
// WMError renderWMLayers();
void undoUpdate();
WMError layoutChange(const WMAction& action);