Skip to content

Commit

Permalink
chore: revert key -> main change in window delegate listener (#19238)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored and zcbenz committed Jul 14, 2019
1 parent dd58f2a commit 29a6dd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
4 changes: 2 additions & 2 deletions atom/browser/ui/cocoa/atom_ns_window_delegate.mm
Expand Up @@ -84,11 +84,11 @@ - (NSRect)windowWillUseStandardFrame:(NSWindow*)window
return frame;
}

- (void)windowDidBecomeKey:(NSNotification*)notification {
- (void)windowDidBecomeMain:(NSNotification*)notification {
shell_->NotifyWindowFocus();
}

- (void)windowDidResignKey:(NSNotification*)notification {
- (void)windowDidResignMain:(NSNotification*)notification {
shell_->NotifyWindowBlur();
}

Expand Down
27 changes: 0 additions & 27 deletions spec/api-browser-window-spec.js
Expand Up @@ -2480,33 +2480,6 @@ describe('BrowserWindow module', () => {
})
})

describe('focus event', () => {
it('should not emit if focusing on a main window with a modal open', (done) => {
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

Expand Down

0 comments on commit 29a6dd0

Please sign in to comment.