On Tue, 4 Jul 2023 05:54:54 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
> When Japanse (IME on) is inputted to the TextFIeld, which is on JFXPanel, > small window for inputting appears on top-left side of screen > >  > > For swing-interop case, WmImeStartComposition starts composition in native > ImmSetCompositionWindow window as "m_useNativeCompWindow" below is true for FX > https://github.com/openjdk/jdk/blob/514816ed7d7dea1fb13d32b80aef89774bee13d3/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp#L3957 > > m_useNativeCompWindow is true because during > sun.awt.im.InputContext#focusGained() calls activateInputMethod which calls > WInputMethod.activate() which calls haveActiveClient() which checks for > clientComponent.getInputMethodRequests(). > Now, in JFXPanel, getInputMethodRequests() returns null as setEmbeddedScene() > is not called yet. > Since getInputMethodRequests() returns null, haveActiveClient() is false > which calls enableNativeIME() with 1 [thereby native composition window is > enabled] > https://github.com/openjdk/jdk/blob/514816ed7d7dea1fb13d32b80aef89774bee13d3/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java#L316 > > Proposed fix is to ensure there is an active client "initially" so that > enableNativeIME() is called with 0 and no native compostion window is shown. > getInputMethodRequests() is called in setEmbeddedScene() so as to make sure > getInputMethodRequest() is initialised to correct > "InputMethodSupport.InputMethodRequestsAdapter.fxRequests" object and not > NULL. > > AFter fix >  This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jfx/pull/1169