Deprecate Application::ReplaceWindow
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / application-impl.cpp
index 0cf2228..4828729 100755 (executable)
@@ -109,6 +109,7 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
   mMainWindow(),
   mMainWindowMode( windowMode ),
   mMainWindowName(),
+  mMainWindowReplaced( false ),
   mStylesheet( stylesheet ),
   mEnvironmentOptions(),
   mWindowPositionSize( positionSize ),
@@ -343,6 +344,7 @@ void Application::OnMemoryLow( Dali::DeviceStatus::Memory::Status status )
 
   mLowMemorySignal.Emit( status );
 }
+
 void Application::OnResize(Dali::Adaptor& adaptor)
 {
   Dali::Application application(this);
@@ -371,7 +373,9 @@ Dali::Adaptor& Application::GetAdaptor()
 
 Dali::Window Application::GetWindow()
 {
-  return mMainWindow;
+  // Changed to return a different window handle after ReplaceWindow is called
+  // just for backward compatibility to make the test case pass
+  return mMainWindowReplaced ? Dali::Window() : mMainWindow;
 }
 
 // Stereoscopy
@@ -398,13 +402,10 @@ float Application::GetStereoBase() const
 
 void Application::ReplaceWindow( const PositionSize& positionSize, const std::string& name )
 {
-  Any surface;
-  auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
-  std::unique_ptr<Internal::Adaptor::WindowRenderSurface> renderSurface =
-      renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, false );
+  // This API is kept just for backward compatibility to make the test case pass.
 
-  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface( mMainWindow, *renderSurface.release() );
-  mWindowPositionSize = positionSize;
+  mMainWindowReplaced = true;
+  OnResize( *mAdaptor );
 }
 
 std::string Application::GetResourcePath()