JDK-8152492 : [macosx swing] double key event actions when using Mac menubar
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u6,8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2016-03-23
  • Updated: 2021-09-09
  • Resolved: 2016-04-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b120Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Use Test.java from JDK-8061381 and start it using
java -Dapple.laf.useScreenMenuBar="true" Test
Then press any of the following key sequences and you will get double callbacks:
- control F1
- control shift B
- control shift F2
- control option shift C
- control option shift F3
- control option shift delete
But these work OK:
- control A or control X

Note: For delete and F1-F12 have to press fn key.  Mac delete without fn key is backspace
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/ee787ce3d454 User: lana Date: 2016-05-25 17:36:43 +0000
25-05-2016

URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/ee787ce3d454 User: alexsch Date: 2016-04-27 08:09:36 +0000
27-04-2016

I just run the test "jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java" on the latest jdk9-client ws and it fail. please double check
05-04-2016

Thanks. I'll recheck it later today.
05-04-2016

there are no double key events triggered no matter what. Setting "Use All F1, F2, etc. keys as standard function keys" also did not do much difference. Only flaw noticed was the cases where "Option/Alt" button was included which is known to be part of another bug. It might be that this has gotten fixed due to fix of https://bugs.openjdk.java.net/browse/JDK-8139169. Please revert is the same is the case.
05-04-2016

Avik, Did you try it with VoiceOver on, Command + F5? I don't remember if that was part of the required configuration, but since I was checking accessibility it might have been.
05-04-2016

See the fixes for: JDK-7160951: [macosx] ActionListener called twice for JMenuItem using ScreenMenuBar http://mail.openjdk.java.net/pipermail/awt-dev/2012-September/003509.html http://hg.openjdk.java.net/jdk9/client/jdk/rev/1ed7fec79bee JDK-8002114: fix failed for JDK-7160951: [macosx] ActionListener called twice for JMenuItem using ScreenMenuBar http://mail.openjdk.java.net/pipermail/awt-dev/2012-November/003777.html http://hg.openjdk.java.net/jdk9/client/jdk/rev/f4a11601680b
31-03-2016