提交 abb6cf64 编写于 作者: L leonidr

8019265: [macosx] apple.laf.useScreenMenuBar regression comparing with jdk6

Reviewed-by: anthony
上级 2d80b073
...@@ -82,8 +82,13 @@ JNF_COCOA_ENTER(env); ...@@ -82,8 +82,13 @@ JNF_COCOA_ENTER(env);
// keys, so we need to do the same translation here that we do // keys, so we need to do the same translation here that we do
// for the regular key down events // for the regular key down events
if ([eventKey length] == 1) { if ([eventKey length] == 1) {
unichar ch = NsCharToJavaChar([eventKey characterAtIndex:0], 0); unichar origChar = [eventKey characterAtIndex:0];
eventKey = [NSString stringWithCharacters: &ch length: 1]; unichar newChar = NsCharToJavaChar(origChar, 0);
if (newChar == java_awt_event_KeyEvent_CHAR_UNDEFINED) {
newChar = origChar;
}
eventKey = [NSString stringWithCharacters: &newChar length: 1];
} }
if ([menuKey isEqualToString:eventKey]) { if ([menuKey isEqualToString:eventKey]) {
......
...@@ -35,10 +35,11 @@ import java.awt.event.*; ...@@ -35,10 +35,11 @@ import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
public class ActionListenerCalledTwiceTest { public class ActionListenerCalledTwiceTest {
static String menuItems[] = { "Item1", "Item2" }; static String menuItems[] = { "Item1", "Item2", "Item3" };
static KeyStroke keyStrokes[] = { static KeyStroke keyStrokes[] = {
KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK), KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK),
KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0) KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
}; };
static volatile int listenerCallCounter = 0; static volatile int listenerCallCounter = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册