United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7131196 [macosx] Cmd-Q does not quit a graphical Java app
JDK-7131196 : [macosx] Cmd-Q does not quit a graphical Java app

Details
Type:
Bug
Submit Date:
2012-01-18
Status:
Closed
Updated Date:
2012-05-17
Project Name:
JDK
Resolved Date:
2012-03-05
Component:
client-libs
OS:
os_x
Sub-Component:
java.awt
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7u4 (b11)

Related Reports
Relates:
Relates:

Sub Tasks

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
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.
                                     
2012-01-25
EVALUATION

This is a regression of 7124283.
                                     
2012-01-25
SUGGESTED FIX

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



Hardware and Software, Engineered to Work Together