summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-12 10:02:59 -0400
committerPietro Gagliardi <[email protected]>2014-03-12 10:02:59 -0400
commit6eea59c30a9fb2d87f5806e6ddc12822228ac169 (patch)
treea609c646e9278fad7b4e47ee51b49d1d178da870
parent95e20a5f3c3f3aa4fb3a601f013a92fc4a41a8ed (diff)
Made programs go to the front of the screen on Mac OS X like other programs do (and like on other platforms).
-rw-r--r--uitask_darwin.go3
1 files changed, 2 insertions, 1 deletions
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
}