diff options
| author | Po Lu <luangruo@yahoo.com> | 2023-06-04 12:04:15 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2023-06-04 12:04:15 +0800 |
| commit | 740af4668c8d9bc8e4ee1e60ebeb366690fee93e (patch) | |
| tree | 99d1b732788406053b9fbeb30609b3c4410d94d6 /java/org/gnu/emacs/EmacsNative.java | |
| parent | c389df992a9f054f9aced4f9a267730b2221e03a (diff) | |
Fix input method synchronization problems
* java/debug.sh (gdbserver_cmd, is_root): Prefer TCP again.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
function `queryAndSpin'.
* java/org/gnu/emacs/EmacsService.java (EmacsService)
(icBeginSynchronous, icEndSynchronous, viewGetSelection): New
synchronization functions.
(resetIC, updateCursorAnchorInfo): Call those instead.
* java/org/gnu/emacs/EmacsView.java (onCreateInputConnection):
Call viewGetSelection.
* src/android.c (JNICALL, android_answer_query_spin): New
functions.
Diffstat (limited to 'java/org/gnu/emacs/EmacsNative.java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsNative.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsNative.java b/java/org/gnu/emacs/EmacsNative.java index eb75201088b..f03736fe614 100644 --- a/java/org/gnu/emacs/EmacsNative.java +++ b/java/org/gnu/emacs/EmacsNative.java @@ -177,6 +177,12 @@ public final class EmacsNative main thread's looper to respond. */ public static native void endSynchronous (); + /* Prevent deadlocks while reliably allowing queries from the Emacs + thread to the main thread to complete by waiting for a query to + start from the main thread, then answer it; assume that a query + is certain to start shortly. */ + public static native void answerQuerySpin (); + /* Return whether or not KEYCODE_VOLUME_DOWN, KEYCODE_VOLUME_UP and KEYCODE_VOLUME_MUTE should be forwarded to Emacs. */ public static native boolean shouldForwardMultimediaButtons (); |
