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

Anton Litvinov anton.litvinov at oracle.com
Mon Apr 16 12:03:50 UTC 2018


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 

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,

More information about the awt-dev mailing list