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.

-------------

Commit messages:
 - Check that input context is active before calling discardMarkedText

Changes: https://git.openjdk.org/jfx/pull/1447/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1447&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8331319
  Stats: 6 lines in 1 file changed: 5 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jfx/pull/1447.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1447/head:pull/1447

PR: https://git.openjdk.org/jfx/pull/1447

Reply via email to