Fix crash issue due to NUI API change 23/264323/2
authorInhong <tukkong123@naver.com>
Thu, 16 Sep 2021 04:49:33 +0000 (13:49 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 16 Sep 2021 05:01:39 +0000 (14:01 +0900)
Change-Id: I6295ba546140681d3f67a47c5d5e4af9ec193e11

ISEDefaultNUI/ISEDefaultNUI.cs

index f045c64..de4d801 100644 (file)
@@ -18,7 +18,7 @@ namespace ISEDefaultNUI
         private static SCLNUI SclNui = null;
         private static SCLDBUS SclDbus = null;
 
-        public Program(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition, WindowType type) : base(styleSheet, windowMode, windowSize, windowPosition, type)
+        public Program(string styleSheet, WindowMode windowMode, WindowType type) : base(styleSheet, windowMode, type)
         {
         }
 
@@ -634,12 +634,8 @@ namespace ISEDefaultNUI
             SclNui.GetInputModeSize(inputMode, (int)WindowAttribute.DisplayMode.Portrait, out portraitWidth, out portraitHeight);
             SclNui.GetInputModeSize(inputMode, (int)WindowAttribute.DisplayMode.Landscape, out landscapeWidth, out landscapeHeight);
 
-            Rectangle portraitRectangle = new Rectangle(0, 0, portraitWidth, portraitHeight);
-            Rectangle landscapeRectangle = new Rectangle(0, 0, landscapeWidth, landscapeHeight);
-            Window.Instance.SetPositionSizeWithOrientation(portraitRectangle, Window.WindowOrientation.Portrait);
-            Window.Instance.SetPositionSizeWithOrientation(landscapeRectangle, Window.WindowOrientation.Landscape);
-            Window.Instance.SetPositionSizeWithOrientation(portraitRectangle, Window.WindowOrientation.PortraitInverse);
-            Window.Instance.SetPositionSizeWithOrientation(landscapeRectangle, Window.WindowOrientation.LandscapeInverse);
+            IntPtr nativeHandle = new Window.SafeNativeWindowHandle().DangerousGetHandle();
+            InputMethodEditor.SetSize(nativeHandle, portraitWidth, portraitHeight, landscapeWidth, landscapeHeight);
         }
 
         private static void UpdateSpaceKey()
@@ -667,10 +663,7 @@ namespace ISEDefaultNUI
         {
             InputMethodEditor.Run(Create, Terminate, Show, Hide);
 
-            Size2D initSize = new Size2D(0, 0);
-            Position2D initPosition = new Position2D(0, 0);
-
-            var app = new Program("", WindowMode.Opaque, initSize, initPosition, WindowType.Ime);
+            var app = new Program("", WindowMode.Opaque, WindowType.Ime);
             app.Run(args);
         }
     }