From f791569d5adb460cf021fbed38a68532ce2b6be4 Mon Sep 17 00:00:00 2001 From: ant Date: Thu, 17 May 2012 21:27:19 +0400 Subject: [PATCH] 7142565: [macosx] Many special keys processed twice in text fields Summary: forward port from 7u4 Reviewed-by: anthony --- src/macosx/native/sun/awt/AWTView.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/macosx/native/sun/awt/AWTView.m b/src/macosx/native/sun/awt/AWTView.m index f737c4e8b..16e8ed7aa 100644 --- a/src/macosx/native/sun/awt/AWTView.m +++ b/src/macosx/native/sun/awt/AWTView.m @@ -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 @@ AWT_ASSERT_APPKIT_THREAD; } -(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]; -- GitLab