diff --git a/ui/cocoa/mainloop.c b/ui/cocoa/mainloop.c index 790a668e3..be88ded4f 100644 --- a/ui/cocoa/mainloop.c +++ b/ui/cocoa/mainloop.c @@ -66,6 +66,8 @@ void* CreateWindow(size_t width, size_t height, const char* title, void* glConte return window; } +static BOOL initialBoot = YES; + void PollEvents(void) { for (;;) { NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask @@ -77,6 +79,10 @@ void PollEvents(void) { } [NSApp sendEvent:event]; } + if (initialBoot) { + [NSApp activateIgnoringOtherApps:YES]; + initialBoot = NO; + } } void UseGLContext(void* glContextPtr) { diff --git a/ui/cocoa/window.go b/ui/cocoa/window.go index 47deef8dd..3de324b35 100644 --- a/ui/cocoa/window.go +++ b/ui/cocoa/window.go @@ -42,7 +42,6 @@ func runWindow(width, height int, title string, sharedContext unsafe.Pointer) *w w.loop() }() <-ch - // TODO: Activate here? return w }