Fix initially disabling input methods. #2047
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently try to disable input methods in
ComposeSceneMediator.init
, but this doesn't work because it's too early. The callenableInputMethods
is ignored unless the component actually has focus.This PR moves the call
enableInputMethods(false)
into a focus-gained listener after focus is requested for the content component.Note that it doesn't seem to be possible to fix this for
SwingSkiaLayerComponent
(i.e. when usingComposePanel
) because the focus there is not requested explicitly by us (but by the system, when the window becomes active).Fixes https://youtrack.jetbrains.com/issue/CMP-3839
Note that this only fixes the issue for JBR (JetBrains Runtime). For some reason Corretto keeps showing the input method toolbar even when
enableInputMethods
is called correctly. It behaves the same in pure Swing. For example, this code correctly disables the toolbar on JBR, but not on Corretto:Testing
Tested manually on
using Pinyin - Simplified input method on macOS.
This should be tested by QA
Release Notes
Fixes - Desktop