]> khamidou — GitHub mirrors - electron.git/commitdiff
BrowserWindow.show() should not focus window, fixes #609.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 8 Sep 2014 07:28:34 +0000 (15:28 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 8 Sep 2014 07:28:34 +0000 (15:28 +0800)
atom/browser/native_window_views.cc
spec/api-browser-window-spec.coffee

index 3c1cd30c23502b86de7c0eb39be4321d27e7d122..42a9e70dd0f23e8c27c1604724b32ae927c17d0e 100644 (file)
@@ -226,7 +226,7 @@ bool NativeWindowViews::IsFocused() {
 }
 
 void NativeWindowViews::Show() {
-  window_->Show();
+  window_->ShowInactive();
 }
 
 void NativeWindowViews::Hide() {
index 3b0cb5c7a8cf8165a265583114df7c8f5b1bae12..6a4a1c494cc524c44d8c0d5bbe3c9ea9a3a733e0 100644 (file)
@@ -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