Apply environment variables to preinitialized app 63/287463/6
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 30 Jan 2023 08:16:52 +0000 (17:16 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 1 Feb 2023 05:30:57 +0000 (14:30 +0900)
Change-Id: Idb66ee33ccf2fed8f71ee5ed5c2cd2f47fdce529

12 files changed:
dali/devel-api/adaptor-framework/application-devel.cpp
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/internal/offscreen/common/offscreen-application-impl.cpp
dali/internal/offscreen/common/offscreen-application-impl.h
dali/internal/window-system/macos/window-system-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/x11/window-base-x.cpp
dali/public-api/adaptor-framework/application.cpp

index 18a233c..886620a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,10 +36,6 @@ Application New(int* argc, char** argv[], const std::string& stylesheet, Applica
 
     // pre-initialized application
     internal->SetCommandLineOptions(argc, argv);
-    if(argc && (*argc > 0))
-    {
-      internal->GetWindow().SetClass((*argv)[0], "");
-    }
     internal->SetStyleSheet(stylesheet);
 
     internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
index e7d2687..6590889 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -83,9 +83,9 @@ void Application::PreInitialize(int* argc, char** argv[])
   {
     Dali::TextAbstraction::FontClientPreInitialize();
 
-    gPreInitializedApplication = new Application(argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL, WindowType::NORMAL, false);
-    gPreInitializedApplication->CreateWindow(); // Only create window
+    gPreInitializedApplication                  = new Application(argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL, WindowType::NORMAL, false);
     gPreInitializedApplication->mLaunchpadState = Launchpad::PRE_INITIALIZED;
+    gPreInitializedApplication->CreateWindow(); // Only create window
   }
 }
 
@@ -98,27 +98,24 @@ Application::Application(int* argc, char** argv[], const std::string& stylesheet
   mAppControlSignal(),
   mLanguageChangedSignal(),
   mRegionChangedSignal(),
-  mEventLoop(nullptr),
   mFramework(nullptr),
   mCommandLineOptions(nullptr),
   mAdaptorBuilder(nullptr),
   mAdaptor(nullptr),
+  mEnvironmentOptions(nullptr),
   mMainWindow(),
   mMainWindowMode(windowMode),
   mMainWindowName(),
   mStylesheet(stylesheet),
-  mEnvironmentOptions(),
   mWindowPositionSize(positionSize),
   mLaunchpadState(Launchpad::NONE),
   mDefaultWindowType(type),
   mUseUiThread(useUiThread),
   mSlotDelegate(this)
 {
-  // Get mName from environment options
-  mMainWindowName = mEnvironmentOptions.GetWindowName();
-  if(mMainWindowName.empty() && argc && (*argc > 0))
+  // Set mName from command-line args
+  if(argc && (*argc > 0))
   {
-    // Set mName from command-line args if environment option not set
     mMainWindowName = (*argv)[0];
   }
 
@@ -128,6 +125,8 @@ Application::Application(int* argc, char** argv[], const std::string& stylesheet
     mUseUiThread = true;
   }
 
+  WindowSystem::Initialize();
+
   mCommandLineOptions = new CommandLineOptions(argc, argv);
   mFramework          = new Framework(*this, *this, argc, argv, applicationType, mUseUiThread);
   mUseRemoteSurface   = (applicationType == Framework::WATCH);
@@ -147,6 +146,8 @@ Application::~Application()
   delete mAdaptorBuilder;
   delete mCommandLineOptions;
   delete mFramework;
+
+  WindowSystem::Shutdown();
 }
 
 void Application::StoreWindowPositionSize(PositionSize positionSize)
@@ -154,14 +155,24 @@ void Application::StoreWindowPositionSize(PositionSize positionSize)
   mWindowPositionSize = positionSize;
 }
 
-void Application::ChangePreInitializedWindowSize()
+void Application::ChangePreInitializedWindowInfo()
 {
+  // Set window name
+  auto windowClassName = mEnvironmentOptions->GetWindowClassName();
+  auto windowName      = mEnvironmentOptions->GetWindowName();
+  if(!windowName.empty())
+  {
+    mMainWindowName = windowName;
+  }
+  mMainWindow.SetClass(mMainWindowName, windowClassName);
+
   // The real screen size may be different from the value of the preinitialized state. Update it.
   Dali::Internal::Adaptor::WindowSystem::UpdateScreenSize();
 
   int screenWidth, screenHeight;
   Dali::Internal::Adaptor::WindowSystem::GetScreenSize(screenWidth, screenHeight);
 
+  // Set window position / size
   if(mWindowPositionSize != PositionSize(0, 0, 0, 0))
   {
     Dali::DevelWindow::SetPositionSize(mMainWindow, mWindowPositionSize);
@@ -173,11 +184,11 @@ void Application::ChangePreInitializedWindowSize()
     mWindowPositionSize.height = mCommandLineOptions->stageHeight;
     mMainWindow.SetSize(Dali::Window::WindowSize(mWindowPositionSize.width, mWindowPositionSize.height));
   }
-  else if(mEnvironmentOptions.GetWindowWidth() && mEnvironmentOptions.GetWindowHeight())
+  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();
+    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)
@@ -191,26 +202,43 @@ void Application::ChangePreInitializedWindowSize()
 
 void Application::CreateWindow()
 {
-  if(mWindowPositionSize.width == 0 && mWindowPositionSize.height == 0)
+  Internal::Adaptor::Window* window;
+
+  if(mLaunchpadState != Launchpad::PRE_INITIALIZED)
   {
-    if(mCommandLineOptions->stageWidth > 0 && mCommandLineOptions->stageHeight > 0)
+    if(mWindowPositionSize.width == 0 && mWindowPositionSize.height == 0)
     {
-      // Command line options override environment options and full screen
-      mWindowPositionSize.width  = mCommandLineOptions->stageWidth;
-      mWindowPositionSize.height = mCommandLineOptions->stageHeight;
+      if(mCommandLineOptions->stageWidth > 0 && mCommandLineOptions->stageHeight > 0)
+      {
+        // Command line options override environment options and full screen
+        mWindowPositionSize.width  = mCommandLineOptions->stageWidth;
+        mWindowPositionSize.height = mCommandLineOptions->stageHeight;
+      }
+      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();
+      }
     }
-    else if(mEnvironmentOptions.GetWindowWidth() && mEnvironmentOptions.GetWindowHeight())
+
+    auto windowClassName = mEnvironmentOptions->GetWindowClassName();
+    auto windowName      = mEnvironmentOptions->GetWindowName();
+    if(!windowName.empty())
     {
-      // Environment options override full screen functionality if command line arguments not provided
-      mWindowPositionSize.width  = mEnvironmentOptions.GetWindowWidth();
-      mWindowPositionSize.height = mEnvironmentOptions.GetWindowHeight();
+      mMainWindowName = windowName;
     }
-  }
 
-  const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
+    window = Internal::Adaptor::Window::New(mWindowPositionSize, mMainWindowName, windowClassName, mDefaultWindowType, mMainWindowMode == Dali::Application::TRANSPARENT);
+  }
+  else
+  {
+    // The position, size and the window name of the pre-initialized application will be updated in ChangePreInitializedWindowInfo()
+    // when the real application is launched.
+    window = Internal::Adaptor::Window::New(mWindowPositionSize, "", "", mDefaultWindowType, mMainWindowMode == Dali::Application::TRANSPARENT);
+  }
 
-  Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(mWindowPositionSize, mMainWindowName, windowClassName, mDefaultWindowType, mMainWindowMode == Dali::Application::TRANSPARENT);
-  mMainWindow                       = Dali::Window(window);
+  mMainWindow = Dali::Window(window);
 
   // Quit the application when the window is closed
   GetImplementation(mMainWindow).DeleteRequestSignal().Connect(mSlotDelegate, &Application::Quit);
@@ -224,14 +252,14 @@ void Application::CreateAdaptor()
 
   Integration::SceneHolder sceneHolder = Integration::SceneHolder(&Dali::GetImplementation(mMainWindow));
 
-  mAdaptor = Adaptor::New(graphicsFactory, sceneHolder, &mEnvironmentOptions);
+  mAdaptor = Adaptor::New(graphicsFactory, sceneHolder, mEnvironmentOptions.get());
 
   Adaptor::GetImplementation(*mAdaptor).SetUseRemoteSurface(mUseRemoteSurface);
 }
 
 void Application::CreateAdaptorBuilder()
 {
-  mAdaptorBuilder = new AdaptorBuilder(mEnvironmentOptions);
+  mAdaptorBuilder = new AdaptorBuilder(*mEnvironmentOptions);
 }
 
 void Application::MainLoop()
@@ -265,6 +293,8 @@ void Application::QuitFromMainLoop()
 
 void Application::OnInit()
 {
+  mEnvironmentOptions = std::unique_ptr<EnvironmentOptions>(new EnvironmentOptions());
+
   mFramework->AddAbortCallback(MakeCallback(this, &Application::QuitFromMainLoop));
 
   CreateAdaptorBuilder();
@@ -278,7 +308,7 @@ void Application::OnInit()
 
   if(mLaunchpadState == Launchpad::PRE_INITIALIZED)
   {
-    ChangePreInitializedWindowSize();
+    ChangePreInitializedWindowInfo();
   }
 
   // Run the adaptor
@@ -521,6 +551,12 @@ void Application::SetCommandLineOptions(int* argc, char** argv[])
   mCommandLineOptions = new CommandLineOptions(argc, argv);
 
   mFramework->SetCommandLineOptions(argc, argv);
+
+  if(argc && (*argc > 0))
+  {
+    // Set mName from command-line args
+    mMainWindowName = (*argv)[0];
+  }
 }
 
 void Application::SetDefaultWindowType(WindowType type)
index 8e334a7..a881314 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_APPLICATION_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,7 +54,6 @@ enum State
 } // namespace Launchpad
 
 class CommandLineOptions;
-class EventLoop;
 
 typedef Dali::Rect<int> PositionSize;
 
@@ -498,9 +497,9 @@ protected:
   void QuitFromMainLoop();
 
   /**
-   * Changes size of preInitialized window
+   * Changes information of preInitialized window
    */
-  void ChangePreInitializedWindowSize();
+  void ChangePreInitializedWindowInfo();
 
 private:
   AppSignalType                      mInitSignal;
@@ -524,13 +523,13 @@ private:
   LowMemorySignalType                mTaskLowMemorySignal;
   DeviceOrientationChangedSignalType mTaskDeviceOrientationChangedSignal;
 
-  EventLoop* mEventLoop;
   Framework* mFramework;
 
   CommandLineOptions* mCommandLineOptions;
 
   Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder; ///< The adaptor builder
   Dali::Adaptor*                           mAdaptor;
+  std::unique_ptr<EnvironmentOptions>      mEnvironmentOptions;
 
   // The Main Window is that window created by the Application during initial startup
   // (previously this was the only window)
@@ -538,13 +537,12 @@ private:
   Dali::Application::WINDOW_MODE mMainWindowMode; ///< Window mode of the main window
   std::string                    mMainWindowName; ///< Name of the main window as obtained from environment options
 
-  std::string        mStylesheet;
-  EnvironmentOptions mEnvironmentOptions;
-  PositionSize       mWindowPositionSize;
-  Launchpad::State   mLaunchpadState;
-  bool               mUseRemoteSurface;
-  WindowType         mDefaultWindowType; ///< Default window's type. It is used when Application is created.
-  bool               mUseUiThread;
+  std::string      mStylesheet;
+  PositionSize     mWindowPositionSize;
+  Launchpad::State mLaunchpadState;
+  WindowType       mDefaultWindowType; ///< Default window's type. It is used when Application is created.
+  bool             mUseRemoteSurface;
+  bool             mUseUiThread;
 
   SlotDelegate<Application> mSlotDelegate;
 
index 634d69f..9510978 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/adaptor/common/thread-controller-interface.h>
 #include <dali/internal/offscreen/common/offscreen-window-impl.h>
+#include <dali/internal/window-system/common/window-system.h>
 
 namespace Dali
 {
@@ -39,6 +40,8 @@ IntrusivePtr<OffscreenApplication> OffscreenApplication::New(uint16_t width, uin
 
 OffscreenApplication::OffscreenApplication(uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent, RenderMode renderMode)
 {
+  Dali::Internal::Adaptor::WindowSystem::Initialize();
+
   // Generate a default window
   IntrusivePtr<Internal::OffscreenWindow> impl = Internal::OffscreenWindow::New(width, height, surface, isTranslucent);
   mDefaultWindow                               = Dali::OffscreenWindow(impl.Get());
@@ -49,6 +52,11 @@ OffscreenApplication::OffscreenApplication(uint16_t width, uint16_t height, Dali
   impl->Initialize(true);
 }
 
+OffscreenApplication::~OffscreenApplication()
+{
+  Dali::Internal::Adaptor::WindowSystem::Shutdown();
+}
+
 void OffscreenApplication::Start()
 {
   // Start the adaptor
index b9b7c8c..6a868ca 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_OFFSCREEN_APPLICATION_IMPL_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@ public:
   /**
    * Destructor
    */
-  virtual ~OffscreenApplication() = default;
+  virtual ~OffscreenApplication();
 
   /**
    * @copydoc Dali::OffscreenApplication::Start()
index 70aa68c..1f67d12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,10 @@ void Initialize()
 {
 }
 
+void Shutdown()
+{
+}
+
 void GetScreenSize( int32_t& width, int32_t& height )
 {
   NSRect r = [[NSScreen mainScreen] frame];
index ddf4ad5..e13f885 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
 #include <dali/internal/input/common/key-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/window-system.h>
 
 // EXTERNAL_HEADERS
 #include <Ecore_Input.h>
@@ -607,8 +606,6 @@ WindowBaseEcoreWl::~WindowBaseEcoreWl()
   if(mOwnSurface)
   {
     ecore_wl_window_free(mEcoreWindow);
-
-    WindowSystem::Shutdown();
   }
 }
 
@@ -624,8 +621,6 @@ void WindowBaseEcoreWl::Initialize(PositionSize positionSize, Any surface, bool
   else
   {
     // we own the surface about to created
-    WindowSystem::Initialize();
-
     mOwnSurface = true;
     CreateWindow(positionSize);
   }
index 762fd65..5eec7b6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -842,8 +842,6 @@ WindowBaseEcoreWl2::~WindowBaseEcoreWl2()
   if(mOwnSurface)
   {
     ecore_wl2_window_free(mEcoreWindow);
-
-    WindowSystem::Shutdown();
   }
 }
 
@@ -859,8 +857,6 @@ void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool
   else
   {
     // we own the surface about to created
-    WindowSystem::Initialize();
-
     mOwnSurface = true;
     CreateWindow(positionSize);
   }
index 09fd990..c215b30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,7 +39,6 @@
 #include <dali/internal/graphics/gles/egl-implementation.h>
 #include <dali/internal/system/common/trigger-event.h>
 #include <dali/internal/window-system/common/display-connection.h>
-#include <dali/internal/window-system/common/window-system.h>
 
 namespace Dali
 {
@@ -61,8 +60,6 @@ NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl(SurfaceSize surfaceSize,
   mTbmQueue(NULL),
   mThreadSynchronization(NULL)
 {
-  Dali::Internal::Adaptor::WindowSystem::Initialize();
-
   if(surface.Empty())
   {
     mSurfaceSize = surfaceSize;
@@ -101,8 +98,6 @@ NativeRenderSurfaceEcoreWl::~NativeRenderSurfaceEcoreWl()
 
     DALI_LOG_INFO(gNativeSurfaceLogFilter, Debug::General, "Own tbm surface queue destroy\n");
   }
-
-  Dali::Internal::Adaptor::WindowSystem::Shutdown();
 }
 
 void NativeRenderSurfaceEcoreWl::SetRenderNotification(TriggerEventInterface* renderNotification)
index e13f26e..ef2e530 100644 (file)
@@ -21,7 +21,6 @@
 // INTERNAL HEADERS
 #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>
 #include <dali/internal/window-system/ubuntu-x11/ecore-x-types.h>
 
 // EXTERNAL_HEADERS
@@ -272,8 +271,6 @@ WindowBaseEcoreX::~WindowBaseEcoreX()
   if(mOwnSurface)
   {
     ecore_x_window_free(mEcoreWindow);
-
-    WindowSystem::Shutdown();
   }
 }
 
@@ -285,8 +282,6 @@ void WindowBaseEcoreX::Initialize(PositionSize positionSize, Any surface, bool i
   // if the surface is empty, create a new one.
   if(surfaceId == 0)
   {
-    WindowSystem::Initialize();
-
     // we own the surface about to created
     mOwnSurface = true;
     CreateWindow(positionSize, isTransparent);
index 9dd0b5b..3f803f7 100644 (file)
@@ -270,9 +270,6 @@ WindowBaseX::~WindowBaseX()
   if(mOwnSurface)
   {
     XDestroyWindow(WindowSystem::GetImplementation().GetXDisplay(), mWindow);
-
-    /**** @todo Should not be destroyed here! ****/
-    WindowSystem::Shutdown();
   }
 }
 
@@ -284,9 +281,6 @@ void WindowBaseX::Initialize(PositionSize positionSize, Any surface, bool isTran
   // if the surface is empty, create a new one.
   if(surfaceId == 0)
   {
-    /**** @todo Should be created from somewhere else! ****/
-    WindowSystem::Initialize();
-
     // we own the surface about to created
     mOwnSurface = true;
     CreateWindow(positionSize, isTransparent);
index 5daf923..d484028 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,10 +39,6 @@ Application Application::New(int* argc, char** argv[])
   {
     // pre-initialized application
     internal->SetCommandLineOptions(argc, argv);
-    if(argc && (*argc > 0))
-    {
-      internal->GetWindow().SetClass((*argv)[0], "");
-    }
   }
   else
   {
@@ -58,10 +54,6 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
   {
     // pre-initialized application
     internal->SetCommandLineOptions(argc, argv);
-    if(argc && (*argc > 0))
-    {
-      internal->GetWindow().SetClass((*argv)[0], "");
-    }
     internal->SetStyleSheet(stylesheet);
   }
   else
@@ -78,10 +70,6 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
   {
     // pre-initialized application
     internal->SetCommandLineOptions(argc, argv);
-    if(argc && (*argc > 0))
-    {
-      internal->GetWindow().SetClass((*argv)[0], "");
-    }
     internal->SetStyleSheet(stylesheet);
 
     internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
@@ -100,10 +88,6 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
   {
     // pre-initialized application
     internal->SetCommandLineOptions(argc, argv);
-    if(argc && (*argc > 0))
-    {
-      internal->GetWindow().SetClass((*argv)[0], "");
-    }
     internal->SetStyleSheet(stylesheet);
 
     internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
@@ -125,10 +109,6 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
   {
     // pre-initialized application
     internal->SetCommandLineOptions(argc, argv);
-    if(argc && (*argc > 0))
-    {
-      internal->GetWindow().SetClass((*argv)[0], "");
-    }
     internal->SetStyleSheet(stylesheet);
 
     internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));