changeset 4757:eb17716663f8

7142565: [macosx] Many special keys processed twice in text fields Reviewed-by: anthony, swingler
author ant
date Fri, 10 Feb 2012 15:07:46 +0400
parents 9abaf274b9a3
children 01c2fdd1b8af
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 Feb 09 19:56:24 2012 +0400
+++ b/src/macosx/native/sun/awt/AWTView.m	Fri Feb 10 15:07:46 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;
@@ -373,6 +372,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];