<AWT Dev> [11] Review request for 8199748: Touch keyboard is not shown, if text component gets focus from other text component

Alexey Ivanov alexey.ivanov at oracle.com
Fri Apr 20 09:46:26 UTC 2018

Hi Anton,

The fix looks good.

Could you please add space after the cast operator before pushing?
No additional review is required for this small code style change, I 


On 19/04/2018 12:12, Anton Litvinov wrote:
> Hello Alexey,
> Thank you for review of this fix and for identification of this issue. 
> Yes, I agree that the touch keyboard should not be hidden, when a 
> focus is moved from one text component to the second, after the TAB 
> key was pressed on the touch keyboard. Hiding it in this scenario, 
> while not hiding the touch keyboard after touching the area of the 
> second text component, is inconsistent.
> The new version of the fix addressing your remark was created.
> Webrev (the 2nd version): 
> http://cr.openjdk.java.net/~alitvinov/8199748/jdk11/webrev.01
> This issue and the original bug is resolved in the 2nd version of the 
> fix by not calling "WToolkit.hideTouchKeyboard()" on 
> "FocusEvent.FOCUS_LOST" event, if a component which gets focus is a 
> text component. Also this version of the fix contains resolution of a 
> possible memory leak from the variables: "compOnTouchDownEvent", 
> "compOnMousePressedEvent" by changing their types to 
> "WeakReference<Component>" and contains small refactoring of "if" 
> expressions in "WToolkit.showOrHideTouchKeyboard(Component, AWTEvent)" 
> method. Could you please look at the 2nd version of the fix.
> Thank you,
> Anton
> On 17/04/2018 17:24, Alexey Ivanov wrote:
>> Hi Anton,
>> Shouldn't touch keyboard remain visible if Tab key on the touch 
>> keyboard itself is pressed? Provided the next focusable component is 
>> a text component, of course.
>> Consider the following scenario: start Notepad and open Replace 
>> dialog. Touch "Find what" field: the touch keyboard appears. Press 
>> Tab on the touch keyboard: the focus moves to "Replace with" field 
>> and touch keyboard stays visible.
>> Regards,
>> Alexey
>> On 16/04/2018 13:03, Anton Litvinov wrote:
>>> Hello,
>>> Could you please review the following fix for the bug.
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8199748
>>> Webrev: http://cr.openjdk.java.net/~alitvinov/8199748/jdk11/webrev.00
>>> In the fix for JDK-8166772 it was deliberately implemented that the 
>>> touch keyboard is shown only on "MouseEvent.MOUSE_RELEASED" event 
>>> and is hidden on "FocusEvent.FOCUS_LOST" event.
>>> The reason of the bug is the fact that, when the touch keyboard is 
>>> already shown for one text component and a user touches another text 
>>> component, then the following 2 events occur in the presented order:
>>> 1. "MouseEvent.MOUSE_RELEASED" event arrives. The touch keyboard is 
>>> shown for the new text component.
>>> 2. "FocusEvent.FOCUS_LOST" event arrives for the previous text 
>>> component. The touch keyboard shown for the new text component 
>>> becomes hidden.
>>> The fix allows not to hide the touch keyboard during processing of 
>>> "FocusEvent.FOCUS_LOST" event, if the touch keyboard has just been 
>>> shown, as a result of processing of "MouseEvent.MOUSE_RELEASED" 
>>> event, for the component which gets focus 
>>> "FocusEvent.getOppositeComponent()".
>>> Thank you,
>>> Anton

More information about the awt-dev mailing list