Merge "[3.0] Move ELDbus init & shutdown to Tizen Framework" into tizen_3.0
[platform/core/uifw/dali-adaptor.git] / adaptors / common / application-impl.cpp
index e43871f..bdc6268 100644 (file)
@@ -94,6 +94,7 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
 
   mCommandLineOptions = new CommandLineOptions(argc, argv);
   mFramework = new Framework( *this, argc, argv, applicationType );
+  mUseRemoteSurface = (applicationType == Framework::WATCH);
 }
 
 Application::~Application()
@@ -103,6 +104,7 @@ Application::~Application()
   delete mFramework;
   delete mCommandLineOptions;
   delete mAdaptor;
+
   mWindow.Reset();
 }
 
@@ -135,6 +137,8 @@ void Application::CreateAdaptor()
   mAdaptor = Dali::Internal::Adaptor::Adaptor::New( mWindow, mContextLossConfiguration, &mEnvironmentOptions );
 
   mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
+
+  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetUseRemoteSurface( mUseRemoteSurface );
 }
 
 void Application::MainLoop(Dali::Configuration::ContextLoss configuration)
@@ -170,9 +174,9 @@ void Application::OnInit()
   mFramework->AddAbortCallback( MakeCallback( this, &Application::QuitFromMainLoop ) );
 
   CreateWindow();
-  CreateAdaptor();
 
-  // Run the adaptor
+  // Start the adaptor
+  CreateAdaptor();
   mAdaptor->Start();
 
   // Check if user requires no vsyncing and set on X11 Adaptor
@@ -341,6 +345,7 @@ void Application::ReplaceWindow(PositionSize windowPosition, const std::string&
   Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
 
   Any nativeWindow = newWindow.GetNativeHandle();
+  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SurfaceSizeChanged( windowPosition );
   Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
   mWindow = newWindow;
 }