From 30b593ae6366044eb65d39e404da74c5733ffa75 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Tue, 26 Sep 2023 18:39:21 +0900 Subject: [PATCH] [NUI] fix IME window crash issue --- .../src/internal/Application/Application.cs | 23 ++++++++++++++++++---- .../src/internal/Application/NUICoreBackend.cs | 2 +- .../src/internal/Interop/Interop.Application.cs | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Tizen.NUI/src/internal/Application/Application.cs b/src/Tizen.NUI/src/internal/Application/Application.cs index ec28235..d66cd53 100755 --- a/src/Tizen.NUI/src/internal/Application/Application.cs +++ b/src/Tizen.NUI/src/internal/Application/Application.cs @@ -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; } diff --git a/src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs b/src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs index f347231..37696d4 100755 --- a/src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs +++ b/src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs @@ -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 { diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs index d453dba..b17b6dd 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs @@ -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); -- 2.7.4