#include <dali/internal/adaptor/common/lifecycle-controller-impl.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
+#include <dali/internal/window-system/common/render-surface-factory.h>
+// To disable a macro with the same name from one of OpenGL headers
#undef Status
namespace Dali
mMainWindow(),
mMainWindowMode( windowMode ),
mMainWindowName(),
+ mMainWindowReplaced( false ),
mStylesheet( stylesheet ),
mEnvironmentOptions(),
mWindowPositionSize( positionSize ),
mLowMemorySignal.Emit( status );
}
+
void Application::OnResize(Dali::Adaptor& adaptor)
{
Dali::Application application(this);
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::New( PositionSize(), "ReplacedWindow" ) : mMainWindow;
}
// Stereoscopy
void Application::ReplaceWindow( const PositionSize& positionSize, const std::string& name )
{
- Dali::Window newWindow = Dali::Window::New( positionSize, name, mMainWindowMode == Dali::Application::TRANSPARENT );
- Window& windowImpl = GetImplementation(newWindow);
- windowImpl.SetAdaptor(*mAdaptor);
-
- Internal::Adaptor::WindowRenderSurface* renderSurface = windowImpl.GetSurface();
+ // This API is kept just for backward compatibility to make the test case pass.
- Any nativeWindow = newWindow.GetNativeHandle();
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
- mMainWindow = newWindow;
- mWindowPositionSize = positionSize;
+ mMainWindowReplaced = true;
+ OnResize( *mAdaptor );
}
std::string Application::GetResourcePath()