aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhishek Kishore2014-04-14 00:32:57 (EDT)
committerArun Thondapu2014-04-14 04:19:23 (EDT)
commit528213c92aecc4d5a81122fe05b4330346ed3e47 (patch)
tree6503b92e94bb616950bf49b68a80861193dc6c23
parentea897abc3bbdebe63455758f5526d5ba34bed848 (diff)
downloadeclipse.platform.swt-528213c92aecc4d5a81122fe05b4330346ed3e47.zip
eclipse.platform.swt-528213c92aecc4d5a81122fe05b4330346ed3e47.tar.gz
eclipse.platform.swt-528213c92aecc4d5a81122fe05b4330346ed3e47.tar.bz2
Bug 368757 - Using ESC as accelerator does not work on OS X, but onrefs/changes/27/24927/2
Windows Change-Id: I5dafb22714ee4073a53a072c7427952da7018791 Signed-off-by: Abhishek Kishore <abhishek.kishore@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
index 369e2e9..1a854f7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
@@ -2284,9 +2284,15 @@ void windowSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event) {
* Feature in Cocoa. For some reason, Cocoa does not perform accelerators
* with ESC key code. The fix is to perform the accelerators ourselves.
*/
- if (nsEvent.keyCode() == 53 /* ESC */ && menuBar != null && !menuBar.isDisposed()) {
- if (menuBar.nsMenu.performKeyEquivalent(nsEvent)) {
- return;
+ if (nsEvent.keyCode() == 53 /* ESC */) {
+ if (menuBar != null && !menuBar.isDisposed()) {
+ if (menuBar.nsMenu.performKeyEquivalent(nsEvent)) {
+ return;
+ }
+ } else if (display.appMenuBar != null && !display.appMenuBar.isDisposed()) {
+ if (display.appMenuBar.nsMenu.performKeyEquivalent(nsEvent)) {
+ return;
+ }
}
}
/**