aboutsummaryrefslogtreecommitdiffstats
path: root/swtmenubar/src-darwin
diff options
context:
space:
mode:
authorRaphaƫl Moll <ralf@android.com>2012-10-21 10:17:42 -0700
committerRaphael Moll <ralf@android.com>2012-10-22 11:34:29 -0700
commita39da6f152565726aaea41bc90d7e86f8759ba19 (patch)
tree18daa168833f4ffeb985310b6f2f153abd61bf27 /swtmenubar/src-darwin
parent8d2b76b49875cc01d8221d7dadece33554185603 (diff)
downloadsdk-a39da6f152565726aaea41bc90d7e86f8759ba19.zip
sdk-a39da6f152565726aaea41bc90d7e86f8759ba19.tar.gz
sdk-a39da6f152565726aaea41bc90d7e86f8759ba19.tar.bz2
SDK Manager: fix SWTMenuBar crash on MacOS X Mountain Lion.
The bug happens when the SDK Manager is open using the embedded class from within Eclipse 4.2 -- the SWT used is then the newer 3.7 which doesn't have the same cocoa interface for menus. The fix is threefold: - If the cocoa enhancer fails, revert to the generic one. This doesn't quite help here since the crash is actually when the native handler is invoked but the setup is fine. - Implement a new enhancer on top of the newer SWT 3.7 APIs that lets us access the About and Preference menus on Mac. That was the whole point of the enhancer workaround since SWT 3.5 an 3.6 don't have access to these menus directly. This new enhancer is used if SWT version 3700+ is used on Mac. - Finally the crash only happens when using the embedded version of the SDK Manager within ADT. When possible this uses the forked standalone version. It will still revert to the embedded one if ADT is started without any tools. The new enhancer for 3.7 on Mac is sub-optimal: since it *adds* a listener to the about/preference Mac menus, that means when it is invoked from within Eclipse these menus will generate 2 events, e.g. bringing both the Eclipse preferences and then the SDK Manager preferences. To support this case properly, we should detect this runs from within Eclipse, not change the about menu and instead integrate the sdk manager pref as a panel in eclipse's prefs. A cheaper workaround is to revert to the default generic enhancer that will create an options menu. Maybe for a later CL. SDK Bug: 38640 Change-Id: Ib1588e401616548a5dc9eb216d3c35b579d3950b
Diffstat (limited to 'swtmenubar/src-darwin')
-rw-r--r--swtmenubar/src-darwin/com/android/menubar/internal/MenuBarEnhancerCocoa.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/swtmenubar/src-darwin/com/android/menubar/internal/MenuBarEnhancerCocoa.java b/swtmenubar/src-darwin/com/android/menubar/internal/MenuBarEnhancerCocoa.java
index 170603a..88d230f 100644
--- a/swtmenubar/src-darwin/com/android/menubar/internal/MenuBarEnhancerCocoa.java
+++ b/swtmenubar/src-darwin/com/android/menubar/internal/MenuBarEnhancerCocoa.java
@@ -234,7 +234,7 @@ public class MenuBarEnhancerCocoa implements IMenuBarEnhancer {
// invoked.
//
// We don't need to set the target here as the current target is the
- // SWTApplicationDelegate and we have registerd the new selectors on
+ // SWTApplicationDelegate and we have registered the new selectors on
// it. So just set the new action to invoke the selector.
invoke(nsMenuitemCls, prefMenuItem, "setAction",
new Object[] {