#include <dali/internal/window-system/common/render-surface-factory.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/window-system.h>
// To disable a macro with the same name from one of OpenGL headers
#undef Status
delete mFramework;
}
+void Application::StoreWindowPositionSize(PositionSize positionSize)
+{
+ mWindowPositionSize = positionSize;
+}
+
+void Application::ChangePreInitializedWindowSize()
+{
+ int screenWidth, screenHeight;
+ Dali::Internal::Adaptor::WindowSystem::GetScreenSize(screenWidth, screenHeight);
+
+ if(mWindowPositionSize != PositionSize(0, 0, 0, 0))
+ {
+ Dali::DevelWindow::SetPositionSize(mMainWindow, mWindowPositionSize);
+ }
+ else if(mCommandLineOptions->stageWidth > 0 && mCommandLineOptions->stageHeight > 0)
+ {
+ // Command line options override environment options and full screen
+ mWindowPositionSize.width = mCommandLineOptions->stageWidth;
+ mWindowPositionSize.height = mCommandLineOptions->stageHeight;
+ mMainWindow.SetSize(Dali::Window::WindowSize(mWindowPositionSize.width, mWindowPositionSize.height));
+ }
+ else if(mEnvironmentOptions.GetWindowWidth() && mEnvironmentOptions.GetWindowHeight())
+ {
+ // Environment options override full screen functionality if command line arguments not provided
+ mWindowPositionSize.width = mEnvironmentOptions.GetWindowWidth();
+ mWindowPositionSize.height = mEnvironmentOptions.GetWindowHeight();
+ mMainWindow.SetSize(Dali::Window::WindowSize(mWindowPositionSize.width, mWindowPositionSize.height));
+ }
+ else if(screenWidth != mWindowPositionSize.width || screenHeight != mWindowPositionSize.height)
+ {
+ //Some apps can receive screen size differently after launching by specifying size in manifest.
+ mWindowPositionSize.width = screenWidth;
+ mWindowPositionSize.height = screenHeight;
+ mMainWindow.SetSize(Dali::Window::WindowSize(mWindowPositionSize.width, mWindowPositionSize.height));
+ }
+}
+
void Application::CreateWindow()
{
if(mWindowPositionSize.width == 0 && mWindowPositionSize.height == 0)
CreateAdaptor();
+ if(mLaunchpadState == Launchpad::PRE_INITIALIZED)
+ {
+ ChangePreInitializedWindowSize();
+ }
+
// Run the adaptor
mAdaptor->Start();
Accessibility::Accessible::SetObjectRegistry(mAdaptor->GetObjectRegistry());
*/
static ApplicationPtr GetPreInitializedApplication();
+ /**
+ * Stores PositionSize of window
+ */
+ void StoreWindowPositionSize(PositionSize positionSize);
+
public: // From Framework::Observer
/**
* Called when the framework is initialised.
*/
void QuitFromMainLoop();
+ /**
+ * Changes size of preInitialized window
+ */
+ void ChangePreInitializedWindowSize();
+
private:
AppSignalType mInitSignal;
AppSignalType mTerminateSignal;
SetClass(name, className);
- mWindowSurface->Map();
-
mOrientation = Orientation::New(this);
// Get OrientationMode
auto accessible = Accessibility::Accessible::Get(v, true);
bridge->AddTopLevelWindow(accessible);
- //FIXME: line below is temporary solution for missing "activate" signal and should be removed
+ // If you call the 'Show' before creating the adaptor, the application cannot know the app resource id.
+ // The show must be called after the adaptor is initialized.
Show();
}
mSurface->SetFullSwapNextFrame();
}
+PositionSize Window::GetPositionSize() const
+{
+ return mSurface->GetPositionSize();
+}
+
Dali::Layer Window::GetRootLayer() const
{
return mScene.GetRootLayer();
internal->SetStyleSheet(stylesheet);
internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
- internal->GetWindow().SetSize(Window::WindowSize(positionSize.width, positionSize.height));
- internal->GetWindow().SetPosition(Window::WindowPosition(positionSize.x, positionSize.y));
+
+ //Store only the value before adaptor is created
+ internal->StoreWindowPositionSize(positionSize);
return Application(internal.Get());
}