7154072: [macosx] swallowing key events
authorant
Thu, 17 May 2012 21:31:55 +0400
changeset 12660 76c54631149e
parent 12659 fa378682b3cb
child 12661 6cf8b7116579
7154072: [macosx] swallowing key events Summary: forward posrt from 7u4 Reviewed-by: anthony
jdk/src/macosx/native/sun/awt/AWTView.m
--- a/jdk/src/macosx/native/sun/awt/AWTView.m	Thu May 17 21:27:19 2012 +0400
+++ b/jdk/src/macosx/native/sun/awt/AWTView.m	Thu May 17 21:31:55 2012 +0400
@@ -393,12 +393,13 @@
 }
 
 -(void) deliverJavaKeyEventHelper: (NSEvent *) event {
-    static id sUnretainedLastKeyEvent = nil;    
-    if (event == sUnretainedLastKeyEvent) {
+    static NSEvent* sLastKeyEvent = nil;
+    if (event == sLastKeyEvent) {
         // The event is repeatedly delivered by keyDown: after performKeyEquivalent:
         return;
     }
-    sUnretainedLastKeyEvent = event;	
+    [sLastKeyEvent release];
+    sLastKeyEvent = [event retain];
 	
     [AWTToolkit eventCountPlusPlus];
     JNIEnv *env = [ThreadUtilities getJNIEnv];