<Swing Dev> RFR: 8229856 [macos] Opening a menu on a JTextField can clear the text selection

Tejpal Rebari tejpal.rebari at oracle.com
Wed Apr 22 06:42:04 UTC 2020


Hi All,

Please review the following fix for jdk15.

 

Bug : https://bugs.openjdk.java.net/browse/JDK-8229856

Webrev : http://cr.openjdk.java.net/~trebari/swing/8229856/webrev00/

 

Issue : This issue exists in AquaLookandFeel only. 

The issue is that while opening a menu on a JTextFeild using control-click over a selection

 that has been created by triple clicking  clears the existing text selection.

 

AquaCaret.mousePressed disables the behaviour of shouldHandleRelease instance variable of DefaultCaret

on a popup trigger event , so the shouldHandleRelease retains its previous value.

If the previous value of shouldHandleRelease is true then DefaultCaret.mouseRelease will clear the selection.

The third click consume the mouseEvent and sets the shouldHandleRelease to true.

 

To fix this issue we should not call super.MousePressed from AquaCaret on a triple click event.

 

Test : Tested on Mac OS X.

 

Thanks and regards

Tejpal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20200421/c1913edd/attachment.htm>


More information about the swing-dev mailing list