chore: revert key -> main change in window delegate listener (#19238)

This commit is contained in:
Erick Zhao
2019-07-13 18:54:20 -07:00
committed by Cheng Zhao
parent dd58f2a6ac
commit 29a6dd079c
2 changed files with 2 additions and 29 deletions

View File

@@ -84,11 +84,11 @@
return frame;
}
- (void)windowDidBecomeKey:(NSNotification*)notification {
- (void)windowDidBecomeMain:(NSNotification*)notification {
shell_->NotifyWindowFocus();
}
- (void)windowDidResignKey:(NSNotification*)notification {
- (void)windowDidResignMain:(NSNotification*)notification {
shell_->NotifyWindowBlur();
}

View File

@@ -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