From 6eea59c30a9fb2d87f5806e6ddc12822228ac169 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 12 Mar 2014 10:02:59 -0400 Subject: [PATCH] Made programs go to the front of the screen on Mac OS X like other programs do (and like on other platforms). --- uitask_darwin.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uitask_darwin.go b/uitask_darwin.go index 6acf080..cbc604f 100644 --- a/uitask_darwin.go +++ b/uitask_darwin.go @@ -79,6 +79,7 @@ var ( _sharedApplication = sel_getUid("sharedApplication") _setActivationPolicy = sel_getUid("setActivationPolicy:") + _activateIgnoringOtherApps = sel_getUid("activateIgnoringOtherApps:") ) func initCocoa() (NSApp C.id, err error) { @@ -89,7 +90,7 @@ func initCocoa() (NSApp C.id, err error) { err = fmt.Errorf("error setting NSApplication activation policy (basically identifies our program as a separate program; needed for several things, such as Dock icon, application menu, window resizing, etc.) (unknown reason)") return } - // TODO we need to call [NSApp activateIgnoringOtherApps:YES] here when we are ready to have the program become active (for now I won't) + C.objc_msgSend_bool(NSApp, _activateIgnoringOtherApps, C.BOOL(C.YES)) // TODO actually do C.NO here? Russ Cox does YES in his devdraw; the docs say the Finder does NO err = mkAppDelegate() return }