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

* chore: revert key -> main

* chore: comment out test that will fail

* more context on commented out test

* remove commented test
This commit is contained in:
Erick Zhao 2019-07-12 01:46:35 -07:00 committed by Cheng Zhao
parent 35294891ae
commit 9a42ddd2b8
2 changed files with 2 additions and 30 deletions

View file

@ -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();
}

View file

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