JDK-7131196 : [macosx] Cmd-Q does not quit a graphical Java app
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2012-01-18
  • Updated: 2012-05-17
  • Resolved: 2012-03-05
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 7
7u4 b11Fixed
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_04-ea"
Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b225)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b09, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.7.2

A DESCRIPTION OF THE PROBLEM :
Screen menu bar keyboard shortcuts don't fire.

REGRESSION.  Last worked in version 7

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
0. Install developer preview b225
1. /Library/Java/JavaVirtualMachines/JDK\ 1.7.0\ Developer\ Preview.jdk/Contents/Home/bin/java -jar /Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar
2. Press Cmd-Q


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The app should quit.

Selecting "Quit SwingSet" from the "SwingSet" app menu does correctly quit the app.
ACTUAL -
Nothing happens. Event goes into a black hole.

This appears to be a problem with command event processing, likely from the hot-wiring of -[AWTView performKeyEquivilant:] to always lob events up to Java, and never letting organic [super performKeyEquivilant:] from trickling up to the menu bar if nothing in Java is overriding the event.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
None. All keyboard shortcuts in the screen menu bar appear to be gobbled by Java.

Comments
SUGGESTED FIX http://cr.openjdk.java.net/~ant/7131196/webrev.0/
25-01-2012

EVALUATION This is a regression of 7124283.
25-01-2012

EVALUATION Indeed, the reason is that performKeyEquivilant: always returns YES, which means to swallow the event. According to the spec it should return NO in order to let NSApp process it in default manner.
25-01-2012