LayerControl: return error if surface is not ready
[apps/agl-service-windowmanager.git] / src / wm_layer_control.cpp
index c5c7913..5b801f7 100644 (file)
@@ -401,8 +401,11 @@ WMError LayerControl::layoutChange(const WMAction& action)
     if(!action.client->isSourceSizeSet())
     {
         ilmSurfaceProperties sp;
-        ilm_getPropertiesOfSurface(surface, &sp);
-        if((sp.origSourceHeight != sp.sourceHeight) || (sp.origSourceWidth != sp.sourceWidth))
+        if (ILM_SUCCESS != ilm_getPropertiesOfSurface(surface, &sp))
+            return WMError::FAIL;
+
+        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);