Found this while researching JDK-8090267. While using an IM window inside a JFXPanel the AWT code will call into the InputMethodRequests on the AWT EventQueue thread. These calls are being passed straight into JavaFX on that same thread. As far as I know the InputMethodRequests can only be called safely on the JavaFX thread.
This happens on all platforms but so far I've only been able to create a reproducible case on Windows 11 (I can't test Win10). The two threads are asking the same Text object to layout the glyphs in an interleaved manner.
Steps to reproduce:
- Switch to Japanese in half-width alphanumeric mode (you should see an "A" in the task bar next to the Japanese IM log)
- Run the attached test program
- Press "a" twice
- Switch to Hiragana (click once on the "A" in the task bar)
- Press the "a" key again
Expected results:
- In the text field you should see two "a" characters followed by a Japanese glyph
Actual results:
- The entered text is duplicated, two a's followed by a Japanese glyph followed by two a's and the same Japanese glyph
This happens on all platforms but so far I've only been able to create a reproducible case on Windows 11 (I can't test Win10). The two threads are asking the same Text object to layout the glyphs in an interleaved manner.
Steps to reproduce:
- Switch to Japanese in half-width alphanumeric mode (you should see an "A" in the task bar next to the Japanese IM log)
- Run the attached test program
- Press "a" twice
- Switch to Hiragana (click once on the "A" in the task bar)
- Press the "a" key again
Expected results:
- In the text field you should see two "a" characters followed by a Japanese glyph
Actual results:
- The entered text is duplicated, two a's followed by a Japanese glyph followed by two a's and the same Japanese glyph
- blocks
-
JDK-8090267 JFXPanel Input Problem
- Resolved
- is blocked by
-
JDK-8221261 Deadlock on macOS in JFXPanel app when handling IME calls
- Resolved
- relates to
-
JDK-8221261 Deadlock on macOS in JFXPanel app when handling IME calls
- Resolved
-
JDK-8322703 Intermittent crash in WebView in a JFXPanel from IME calls on macOS
- Resolved
-
JDK-8324666 JFXPanel: Japanese IME window initially shown in the corner (Windows)
- Open
- links to
-
Commit openjdk/jfx/11706581
-
Review(master) openjdk/jfx/1337
(2 links to)