From 66f6b0d0291d3170012607e008235a5e1f3eb8bc Mon Sep 17 00:00:00 2001 From: Till Brychcy Date: Tue, 19 Sep 2017 21:03:24 +0200 Subject: Bug 457921 - [RCP] RCP application menu not shown when launched from Eclipse on OS X 10.9 Change-Id: Ie9b23c0f7c80c0b3c80b5fd41a18d61a54e392eb Signed-off-by: Till Brychcy --- .../library/cocoa/eclipseCocoa.c | 7 ++----- .../library/cocoa/eclipseCocoaCommon.c | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c index 023223103..6e6215d2d 100644 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c @@ -97,11 +97,8 @@ static NSWindow* window = nil; } + (int)show: (NSString *) featureImage { - ProcessSerialNumber psn; - if (GetCurrentProcess(&psn) == noErr) { - TransformProcessType(&psn, kProcessTransformToForegroundApplication); - SetFrontProcess(&psn); - } + [[NSApplication sharedApplication] setActivationPolicy: NSApplicationActivationPolicyRegular]; + [[NSRunningApplication currentApplication] activateWithOptions: NSApplicationActivateIgnoringOtherApps]; if (window != NULL) return 0; /*already showing */ if (featureImage == NULL) diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c index 1794dc44b..04bf97ff6 100644 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c @@ -30,12 +30,8 @@ int initialized = 0; static void init() { if (!initialized) { - ProcessSerialNumber psn; - if (GetCurrentProcess(&psn) == noErr) { - TransformProcessType(&psn, kProcessTransformToForegroundApplication); - SetFrontProcess(&psn); - } - [NSApplication sharedApplication]; + [[NSApplication sharedApplication] setActivationPolicy: NSApplicationActivationPolicyRegular]; + [[NSRunningApplication currentApplication] activateWithOptions: NSApplicationActivateIgnoringOtherApps]; initialized= true; } } -- cgit v1.2.3