[Tizen] Temporarily modified so that window is no null
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 28 May 2020 05:18:31 +0000 (14:18 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 28 May 2020 05:18:35 +0000 (14:18 +0900)
Change-Id: I98d5bfa02b508418bfc973a8500d5270e3c3f1f3

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 9d8c830..d82b0c6 100644 (file)
@@ -49,23 +49,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;
 }