RFR: 8090267: JFXPanel Input Problem
ctipper
duke at openjdk.org
Wed Jul 26 11:28:51 UTC 2023
On Tue, 4 Jul 2023 05:54:54 GMT, Prasanta Sadhukhan <psadhukhan at 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
> 
I'm a client side developer trying to add a custom input method event handler to my app and I have noticed this problem on Windows with the native client. These APIs don't seem to have an great deal of online documentation and I can't even get it to work in macOS. Sorry but I don't have privileges for JIRA.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1169#issuecomment-1651237983
More information about the openjfx-dev
mailing list