Skip to content

Commit

Permalink
chore: revert key -> main change in window delegate listener (#19213)
Browse files Browse the repository at this point in the history
* chore: revert key -> main

* chore: comment out test that will fail

* more context on commented out test

* remove commented test
  • Loading branch information
erickzhao authored and zcbenz committed Jul 12, 2019
1 parent 3529489 commit 9a42ddd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
4 changes: 2 additions & 2 deletions shell/browser/ui/cocoa/atom_ns_window_delegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,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
28 changes: 0 additions & 28 deletions spec/api-browser-window-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9a42ddd

Please sign in to comment.