]> khamidou — GitHub mirrors - electron.git/commitdiff
mac: BrowserWindow.show() should also focus on window
authorCheng Zhao <zcbenz@gmail.com>
Sun, 28 Dec 2014 01:41:13 +0000 (17:41 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 28 Dec 2014 01:41:13 +0000 (17:41 -0800)
atom/browser/native_window_mac.mm

index c57ceee97fb39ba1b519d92bb6ad86a22e37eb99..0f5b39ee5b33234426462d9214ad444419b5f79c 100644 (file)
@@ -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];
 }