diff --git a/src/main/java/featurecat/lizzie/gui/MainFrame.java b/src/main/java/featurecat/lizzie/gui/MainFrame.java index 69c91ea1..7f0e2f4f 100644 --- a/src/main/java/featurecat/lizzie/gui/MainFrame.java +++ b/src/main/java/featurecat/lizzie/gui/MainFrame.java @@ -18,6 +18,7 @@ import java.awt.datatransfer.Transferable; import java.awt.event.MouseEvent; import java.awt.event.MouseWheelEvent; +import java.awt.im.InputContext; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -162,6 +163,12 @@ public void addSuggestionAsBranch() {} public abstract void pasteSgf(); public void editComment() { + InputContext context = InputContext.getInstance(); + boolean oldCompositionEnabled = false; + try { + oldCompositionEnabled = context.isCompositionEnabled(); + } catch (UnsupportedOperationException e) { + } String oldComment = Lizzie.board.getHistory().getData().comment; // https://stackoverflow.com/questions/7765478/how-to-add-text-area-on-joptionpane // https://stackoverflow.com/a/55678093 @@ -178,6 +185,10 @@ public void editComment() { Lizzie.board.getHistory().getData().comment = textArea.getText(); refresh(); } + try { + context.setCompositionEnabled(oldCompositionEnabled); + } catch (UnsupportedOperationException e) { + } } public void copyCommentToClipboard() {