summaryrefslogtreecommitdiffstats
path: root/src/wm_layer_control.cpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-11-29 21:30:33 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-12-03 13:09:11 +0900
commit7ca956bddffa9b251fc9df88a07c49a78e83a379 (patch)
tree1584a09c93951f02d4b4e2a49a122a15b8c44ff4 /src/wm_layer_control.cpp
parenta96fae7e99c2d13bc864d919cbdbcd68ba9cb841 (diff)
Fix app surface is set to position (0, 0)
Sometimes, ivi_wm_surface_size signal doesn't reach WM. In that time, surface is not placed in the set place. This patch fix the issue. Change-Id: Id7137557d5aaae373fedbb70379179ab50205c60 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/wm_layer_control.cpp')
-rw-r--r--src/wm_layer_control.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp
index 011402d..17443de 100644
--- a/src/wm_layer_control.cpp
+++ b/src/wm_layer_control.cpp
@@ -394,7 +394,22 @@ WMError LayerControl::layoutChange(const WMAction& action)
auto rect = this->getAreaSize(action.area);
HMI_DEBUG("Set layout %d, %d, %d, %d",rect.x, rect.y, rect.w, rect.h);
- ilm_commitChanges();
+
+ // Sometimes, ivi_wm_surface_size signal doesn't reach window manager,
+ // then, Window Manager set set source size = 0.
+ if(!action.client->isSourceSizeSet())
+ {
+ ilmSurfaceProperties sp;
+ ilm_getPropertiesOfSurface(surface, &sp);
+ if((sp.origSourceHeight != sp.sourceHeight) || (sp.origSourceWidth != sp.sourceWidth))
+ {
+ HMI_SEQ_NOTICE(action.req_num, "set source size w:%d h%d", sp.origSourceWidth, sp.origSourceHeight);
+ ilm_surfaceSetSourceRectangle(surface, 0, 0, sp.origSourceWidth, sp.origSourceHeight);
+ ilm_commitChanges();
+ action.client->setSurfaceSizeCorrectly();
+ }
+ }
+
ilm_surfaceSetDestinationRectangle(surface, rect.x, rect.y, rect.w, rect.h);
ilm_commitChanges();
for(auto &wm_layer: this->wm_layers)