Skip to content

Commit 3b9ebf7

Browse files
committed
Disable IME outside of Windows builds
1 parent 39c8b22 commit 3b9ebf7

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/TSMapEditor/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace TSMapEditor
44
{
55
public static class Constants
66
{
7-
public const string ReleaseVersion = "1.7.0";
7+
public const string ReleaseVersion = "1.7.1";
88

99
public static int CellSizeX = 48;
1010
public static int CellSizeY = 24;

src/TSMapEditor/Rendering/GameClass.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
using System.Threading;
1212
#if WINDOWS
1313
using System.Windows.Forms;
14+
using TSMapEditor.UI.IME;
1415
#endif
1516
using TSMapEditor.CCEngine;
1617
using TSMapEditor.Misc;
1718
using TSMapEditor.Settings;
1819
using TSMapEditor.UI;
19-
using TSMapEditor.UI.IME;
2020

2121
#if !DEBUG
2222
using System.Windows.Forms;
@@ -195,8 +195,10 @@ protected override void Initialize()
195195
PanelBorderColor = new Color(196, 196, 196)
196196
};
197197

198+
#if WINDOWS
198199
IMEHandler imeHandler = IMEHandler.Create(this);
199200
windowManager.IMEHandler = imeHandler;
201+
#endif
200202

201203
InitMainMenu();
202204
}

src/TSMapEditor/UI/IME/IMEHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if WINDOWS
12
#nullable enable
23
using System;
34
using System.Collections.Concurrent;
@@ -209,3 +210,4 @@ bool IIMEHandler.HandleEscapeKey(XNATextBox sender)
209210

210211
void IIMEHandler.OnTextChanged(XNATextBox sender) { }
211212
}
213+
#endif

src/TSMapEditor/UI/IME/WinFormsIMEHandler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#nullable enable
1+
#if WINDOWS
2+
#nullable enable
23
using System;
34

45
using ImeSharp;
@@ -54,3 +55,4 @@ public override void StopTextComposition()
5455
public override void SetTextInputRectangle(Rectangle rect)
5556
=> InputMethod.SetTextInputRect(rect.X, rect.Y, rect.Width, rect.Height);
5657
}
58+
#endif

0 commit comments

Comments
 (0)