[NUI] fix IME window crash issue
authordongsug.song <dongsug.song@samsung.com>
Tue, 26 Sep 2023 09:39:21 +0000 (18:39 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 27 Sep 2023 00:43:05 +0000 (09:43 +0900)
src/Tizen.NUI/src/internal/Application/Application.cs
src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs
src/Tizen.NUI/src/internal/Interop/Interop.Application.cs

index ec28235..d66cd53 100755 (executable)
@@ -1553,13 +1553,13 @@ namespace Tizen.NUI
             return instance;
         }
 
-        public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
+        public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
         {
             if (instance != null)
             {
                 return instance;
             }
-            Application ret = New(1, stylesheet, windowMode, type);
+            Application ret = New(args, stylesheet, windowMode, type);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
             instance = ret;
@@ -1700,12 +1700,27 @@ namespace Tizen.NUI
             return ret;
         }
 
-        public static Application New(int argc, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
+        public static Application New(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
         {
+            int argc = 0;
+            string argvStr = "";
+            try
+            {
+                argc = args.Length;
+                argvStr = string.Join(" ", args);
+            }
+            catch (Exception exception)
+            {
+                Tizen.Log.Fatal("NUI", "[Error] got exception during Application New(), this should not occur, message : " + exception.Message);
+                Tizen.Log.Fatal("NUI", "[Error] error line number : " + new StackTrace(exception, true).GetFrame(0).GetFileLineNumber());
+                Tizen.Log.Fatal("NUI", "[Error] Stack Trace : " + exception.StackTrace);
+                throw;
+            }
+
             // It will be removed until dali APIs are prepared.
             Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
 
-            Application ret = new Application(Interop.Application.New(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
+            Application ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index f347231..37696d4 100755 (executable)
@@ -186,7 +186,7 @@ namespace Tizen.NUI
             }
             else if (defaultWindowType != WindowType.Normal)
             {
-                application = Application.NewApplication(stylesheet, windowMode, defaultWindowType);
+                application = Application.NewApplication(args, stylesheet, windowMode, defaultWindowType);
             }
             else
             {
index d453dba..b17b6dd 100755 (executable)
@@ -90,7 +90,7 @@ namespace Tizen.NUI
             public static extern global::System.IntPtr New(int jarg1, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New__SWIG_5")]
-            public static extern global::System.IntPtr New(int jarg1, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5, int jarg6);
+            public static extern global::System.IntPtr New(int argc, string argv, string styleSheet, int windowMode, global::System.Runtime.InteropServices.HandleRef initRectangle, int windowType);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New__SWIG_6")]
             public static extern global::System.IntPtr New(int argc, string argv, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5, bool jarg7);