From 01bea42cbff84ca76f339088f19a42cddfe83cbb Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 9 Jun 2023 18:05:26 +0800 Subject: Avoid responding to input method queries asynchronously * src/androidterm.c (handle_one_android_event): Don't answer queries here; just rely on the event interrupting android_select. This avoids exposing buffer contents to input methods while a command is being executed. * src/textconv.c (TEXTCONV_DEBUG, really_commit_text) (really_finish_composing_text, really_set_composing_text) (really_set_composing_region, really_delete_surrounding_text) (really_set_point_and_mark, get_extracted_text): Add debugging printouts. --- src/androidterm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/androidterm.c') diff --git a/src/androidterm.c b/src/androidterm.c index 77f2bd1c7a0..704ff5f5d85 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -1053,12 +1053,12 @@ handle_one_android_event (struct android_display_info *dpyinfo, used to make Android run stuff. */ if (!event->xaction.window && !event->xaction.action) - { - /* Check for and run anything the UI thread wants to run on the main - thread. */ - android_check_query (); - goto OTHER; - } + /* Don't run queries here, as it may run inside editor + commands, which can expose an inconsistent view of buffer + contents to the input method during command execution. + + Instead, wait for Emacs to return to `android_select'. */ + goto OTHER; f = any; -- cgit v1.2.1