changeset 5548:c00d6508afce

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 f9217bd87199
children 17c5e1a12965
files src/macosx/native/sun/awt/AWTView.m
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/native/sun/awt/AWTView.m	Thu May 17 15:41:09 2012 +0400
+++ b/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];