RFR: 8331319: IME Window breaks after popup menu
Kevin Rushforth
kcr at openjdk.org
Tue Apr 30 15:09:08 UTC 2024
On Tue, 30 Apr 2024 14:52:50 GMT, Martin Fox <mfox at 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.
Looks good. I verified on my macOS 13.6.6 system that this fixes the problem. I also verified that the test program from JDK-8320912 still works correctly.
-------------
Marked as reviewed by kcr (Lead).
PR Review: https://git.openjdk.org/jfx/pull/1447#pullrequestreview-2031686652
More information about the openjfx-dev
mailing list