From: Cheng Zhao Date: Sun, 28 Dec 2014 01:41:13 +0000 (-0800) Subject: mac: BrowserWindow.show() should also focus on window X-Git-Tag: v0.20.3~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ded58b8e65ddc8cf938d1677eaf41960575fb98a;p=electron.git mac: BrowserWindow.show() should also focus on window --- diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index c57ceee9..0f5b39ee 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -386,6 +386,10 @@ bool NativeWindowMac::IsFocused() { } void NativeWindowMac::Show() { + // This method is supposed to put focus on window, however if the app does not + // have focus then "makeKeyAndOrderFront" will only show the window. + [NSApp activateIgnoringOtherApps:YES]; + [window_ makeKeyAndOrderFront:nil]; }