diff options
| author | Po Lu | 2023-06-05 10:38:25 +0800 |
|---|---|---|
| committer | Po Lu | 2023-06-05 10:38:25 +0800 |
| commit | 66783af554176c68cb58726aeff4ae6a23224234 (patch) | |
| tree | 076a6d6e2232696a378077f7cb0fa8553b090a4c /java | |
| parent | 6f0ebe11aaf9b2e54df14147cd2f62b048ffec9a (diff) | |
| download | emacs-66783af554176c68cb58726aeff4ae6a23224234.tar.gz emacs-66783af554176c68cb58726aeff4ae6a23224234.zip | |
Update Android port
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
function clearInputFlags.
* java/org/gnu/emacs/EmacsView.java (onCreateInputConnection):
Stop reporting changes after a new input method connection is
established.
* src/androidterm.c (android_handle_ime_event): Implement that
change.
(JNICALL): New function.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsNative.java | 1 | ||||
| -rw-r--r-- | java/org/gnu/emacs/EmacsView.java | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/java/org/gnu/emacs/EmacsNative.java b/java/org/gnu/emacs/EmacsNative.java index f03736fe614..cb1c6caa79a 100644 --- a/java/org/gnu/emacs/EmacsNative.java +++ b/java/org/gnu/emacs/EmacsNative.java | |||
| @@ -221,6 +221,7 @@ public final class EmacsNative | |||
| 221 | int flags); | 221 | int flags); |
| 222 | public static native void requestSelectionUpdate (short window); | 222 | public static native void requestSelectionUpdate (short window); |
| 223 | public static native void requestCursorUpdates (short window, int mode); | 223 | public static native void requestCursorUpdates (short window, int mode); |
| 224 | public static native void clearInputFlags (short window); | ||
| 224 | 225 | ||
| 225 | 226 | ||
| 226 | /* Return the current value of the selection, or -1 upon | 227 | /* Return the current value of the selection, or -1 upon |
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java index c223dfa7911..a78dec08839 100644 --- a/java/org/gnu/emacs/EmacsView.java +++ b/java/org/gnu/emacs/EmacsView.java | |||
| @@ -627,6 +627,10 @@ public final class EmacsView extends ViewGroup | |||
| 627 | return null; | 627 | return null; |
| 628 | } | 628 | } |
| 629 | 629 | ||
| 630 | /* Reset flags set by the previous input method. */ | ||
| 631 | |||
| 632 | EmacsNative.clearInputFlags (window.handle); | ||
| 633 | |||
| 630 | /* Obtain the current position of point and set it as the | 634 | /* Obtain the current position of point and set it as the |
| 631 | selection. Don't do this under one specific situation: if | 635 | selection. Don't do this under one specific situation: if |
| 632 | `android_update_ic' is being called in the main thread, trying | 636 | `android_update_ic' is being called in the main thread, trying |
| @@ -663,10 +667,6 @@ public final class EmacsView extends ViewGroup | |||
| 663 | 667 | ||
| 664 | if (inputConnection == null) | 668 | if (inputConnection == null) |
| 665 | inputConnection = new EmacsInputConnection (this); | 669 | inputConnection = new EmacsInputConnection (this); |
| 666 | else | ||
| 667 | /* Reset the composing region, in case there is still composing | ||
| 668 | text. */ | ||
| 669 | inputConnection.finishComposingText (); | ||
| 670 | 670 | ||
| 671 | /* Return the input connection. */ | 671 | /* Return the input connection. */ |
| 672 | return inputConnection; | 672 | return inputConnection; |