changeset 12659:fa378682b3cb

7142565: [macosx] Many special keys processed twice in text fields Summary: forward port from 7u4 Reviewed-by: anthony
author ant
date Thu, 17 May 2012 21:27:19 +0400
parents 4eaff9680674
children 76c54631149e
files jdk/src/macosx/native/sun/awt/AWTView.m
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/macosx/native/sun/awt/AWTView.m	Thu May 17 15:41:09 2012 +0400
+++ b/jdk/src/macosx/native/sun/awt/AWTView.m	Thu May 17 21:27:19 2012 +0400
@@ -48,7 +48,6 @@
 //#define IM_DEBUG TRUE
 //#define EXTRA_DEBUG
 
-
 static BOOL shouldUsePressAndHold() {
     static int shouldUsePressAndHold = -1;
     if (shouldUsePressAndHold != -1) return shouldUsePressAndHold;
@@ -394,6 +393,13 @@
 }
 
 -(void) deliverJavaKeyEventHelper: (NSEvent *) event {
+    static id sUnretainedLastKeyEvent = nil;    
+    if (event == sUnretainedLastKeyEvent) {
+        // The event is repeatedly delivered by keyDown: after performKeyEquivalent:
+        return;
+    }
+    sUnretainedLastKeyEvent = event;	
+	
     [AWTToolkit eventCountPlusPlus];
     JNIEnv *env = [ThreadUtilities getJNIEnv];