From: Cheng Zhao Date: Mon, 8 Sep 2014 07:28:34 +0000 (+0800) Subject: BrowserWindow.show() should not focus window, fixes #609. X-Git-Tag: v0.16.1~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=11992240869b74ff371959c227255a2d3638c818;p=electron.git BrowserWindow.show() should not focus window, fixes #609. --- diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 3c1cd30c..42a9e70d 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -226,7 +226,7 @@ bool NativeWindowViews::IsFocused() { } void NativeWindowViews::Show() { - window_->Show(); + window_->ShowInactive(); } void NativeWindowViews::Hide() { diff --git a/spec/api-browser-window-spec.coffee b/spec/api-browser-window-spec.coffee index 3b0cb5c7..6a4a1c49 100644 --- a/spec/api-browser-window-spec.coffee +++ b/spec/api-browser-window-spec.coffee @@ -56,6 +56,11 @@ describe 'browser-window module', -> done() w.loadUrl 'about:blank' + describe 'BrowserWindow.show()', -> + it 'should not focus window', -> + w.show() + assert !w.isFocused() + describe 'BrowserWindow.focus()', -> it 'does not make the window become visible', -> assert.equal w.isVisible(), false