[Tizen] Temporarily modified so that window is no null
authorSeungho, Baek <sbsh.baek@samsung.com>
Tue, 14 Jul 2020 08:32:20 +0000 (17:32 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Tue, 14 Jul 2020 08:32:27 +0000 (17:32 +0900)
This reverts commit 65a1056c61515505a58ba5d7bfdf0ad2b83b6ffc.

Change-Id: Ia5a322bf6c4e164aa0feea89822b578a170f79ce

dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp
dali/public-api/adaptor-framework/window.cpp

index ff22534..2b4b480 100644 (file)
@@ -55,9 +55,9 @@ int OnInstanceInit(widget_base_instance_h instanceHandle, bundle *content, int w
   }
   else
   {
-    window = Dali::Window::New(PositionSize(0,0,w,h) ,"", false);
-    if( window )
+    if(Internal::Adaptor::Adaptor::GetImplementation(application->GetAdaptor()).IsMultipleWindowSupported())
     {
+      window = Dali::Window::New(PositionSize(0,0,w,h) ,"", false);
       DALI_LOG_RELEASE_INFO("Widget Instance create new Window  (win:%p, cnt:%d) (%dx%d) (id:%s )\n", window, application->GetWidgetCount(), w, h, std::string(id).c_str());
     }
     else
index c073254..3c5d6fa 100644 (file)
@@ -47,23 +47,20 @@ Window Window::New(PositionSize posSize, const std::string& name, const std::str
     isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
   }
 
-  if (isNewWindowAllowed)
+  if (!isNewWindowAllowed)
   {
-    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
+    DALI_LOG_ERROR("This device can't support multiple windows.\n");
+  }
+  Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
 
-    Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
+  Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
 
-    if (isAdaptorAvailable)
-    {
-      Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
-      Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent);
-    }
-    newWindow = Window(window);
-  }
-  else
+  if (isAdaptorAvailable)
   {
-    DALI_LOG_ERROR("This device can't support multiple windows.\n");
+    Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
+    Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent);
   }
+  newWindow = Window(window);
 
   return newWindow;
 }