diff --git a/atom/renderer/lib/override.coffee b/atom/renderer/lib/override.coffee index 15acbdd48bde..5280f1927e80 100644 --- a/atom/renderer/lib/override.coffee +++ b/atom/renderer/lib/override.coffee @@ -122,7 +122,7 @@ Object.defineProperty window.history, 'length', Object.defineProperty document, 'hidden', get: -> currentWindow = remote.getCurrentWindow() - !currentWindow.isFocused() || !currentWindow.isVisible() + currentWindow.isMinimized() || !currentWindow.isVisible() Object.defineProperty document, 'visibilityState', get: -> diff --git a/spec/chromium-spec.coffee b/spec/chromium-spec.coffee index 5559c36eba89..d19933393f4f 100644 --- a/spec/chromium-spec.coffee +++ b/spec/chromium-spec.coffee @@ -45,6 +45,14 @@ describe 'chromium feature', -> done() w.loadURL url + it 'is set correctly when window is inactive', (done) -> + w = new BrowserWindow(show:false) + w.webContents.on 'ipc-message', (event, args) -> + assert.deepEqual args, ['hidden', false] + done() + w.showInactive() + w.loadURL url + xdescribe 'navigator.webkitGetUserMedia', -> it 'calls its callbacks', (done) -> @timeout 5000