diff --git a/shell/browser/ui/cocoa/atom_ns_window_delegate.mm b/shell/browser/ui/cocoa/atom_ns_window_delegate.mm index 4b3bc69ddd21..3b9e498f64bb 100644 --- a/shell/browser/ui/cocoa/atom_ns_window_delegate.mm +++ b/shell/browser/ui/cocoa/atom_ns_window_delegate.mm @@ -88,11 +88,11 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle; return frame; } -- (void)windowDidBecomeKey:(NSNotification*)notification { +- (void)windowDidBecomeMain:(NSNotification*)notification { shell_->NotifyWindowFocus(); } -- (void)windowDidResignKey:(NSNotification*)notification { +- (void)windowDidResignMain:(NSNotification*)notification { shell_->NotifyWindowBlur(); } diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 1df7768486d5..560b03d4dff2 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1325,34 +1325,6 @@ describe('BrowserWindow module', () => { }) }) - describe('focus event', () => { - it('should not emit if focusing on a main window with a modal open', (done) => { - const childWindowClosed = false - const child = new BrowserWindow({ - parent: w, - modal: true, - show: false - }) - - child.once('ready-to-show', () => { - child.show() - }) - - child.on('show', () => { - w.once('focus', () => { - expect(child.isDestroyed()).to.equal(true) - done() - }) - w.focus() // this should not trigger the above listener - child.close() - }) - - // act - child.loadURL(server.url) - w.show() - }) - }) - describe('sheet-begin event', () => { let sheet = null