On Tue, 30 Apr 2024 14:52:50 GMT, Martin Fox <m...@openjdk.org> wrote:
> When focus moves away from a node JavaFX calls `finishInputMethodComposition` > so glass can clean up any in-progress IME editing. On Mac we call > `discardMarkedText` on the view's NSTextInputContext to dismiss the IME. > > It appears that the OS can get confused if `discardMarkedText` is called on > an NSTextInputContext that is not the current active context. JavaFX popups > are displayed in windows that don't have OS focus and therefore do not have > the active input context but the JavaFX scene associated with the popup > doesn't know this and still makes calls to manipulate the IME. This seems to > be triggering a bug in the OS that leads to bad behavior which persists until > the user moves focus away from the main JavaFX stage altogether and then > brings it back. Seems to work with the little test program. Observed a weird behavior in the Monkey Tester https://github.com/andy-goryachev-oracle/MonkeyTest - open TextArea page - set font to System Regular - select text: "Writing Systems" - click on any English word, invoke IME (I use Japanese), observe candidate inserted correctly - click on non-English word, invoke IME, the candidate is still shows up correctly - click on an English word, invoke IME and the candidate shows garbage. It seems to me it might be using font from the previous invocation? This could be a different issue though.  ------------- PR Comment: https://git.openjdk.org/jfx/pull/1447#issuecomment-2085670379