On Wed, 20 Jan 2021 12:28:36 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>>> > Fix:
>>> > It is necessary to take care of unconfirmed composition string once the 
>>> > IME is going to be disabled.
>>> 
>>> The fix commits the unconfirmed composition string. Committing is better 
>>> than discarding. Is it possible to preserve the 
>> state and to leave the string uncommitted?
>> 
>> The fix reverts the previous (correct) behaviour back. It is unnecessary to 
>> store the state and keep the string. That activity may be quite complicated 
>> and requires additional resources especially if there are several components 
>> with active IME
>
>> > The fix commits the unconfirmed composition string. Committing is better 
>> > than discarding. Is it possible to preserve the
>> > state and to leave the string uncommitted?
>> 
>> The fix reverts the previous (correct) behaviour back.
> 
> According to the bug description, it used to stay in uncommitted state.
> 
>> It is unnecessary to store the state and keep the string. That activity may 
>> be quite complicated and requires additional resources especially if there 
>> are several components with active IME
> 
> I definitely agree that committing the text is better behaviour than 
> discarding uncommitted text.
> 
> I am for accepting these changes unless we can keep the text uncommitted and 
> allow the user to work with text when the focus moves back to the text 
> component.

An interesting thing is that the test (see AWTTextTest1.java) behaves like a 
native application if TextField is replaced with JTextField. It appears AWT and 
Swing components behave differently while processing input method requests. 
That’s a great topic to discuss but it is out of scope for this PR. We can open 
a separate bug for it, if any.

Going back to the current PR. I updated the fix. Now we will commit the 
composition string if there is an active client. That changes eliminates the 
issue described in JDK-8258805. Also the behaviour of AWTTextTest1 is the same 
as it used to be on the previous versions w/o the fix.

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

PR: https://git.openjdk.java.net/jdk/pull/2142

Reply via email to