Finalized browser-window show & hide events, added tests & fixed os x implementation

This commit is contained in:
Arek Sredzki 2016-03-08 11:11:17 -08:00
parent c1267b2320
commit fcc1f4d7ed
4 changed files with 73 additions and 9 deletions

View file

@ -32,7 +32,7 @@ BrowserWindow.prototype._init = function() {
// window.resizeTo(...)
// window.moveTo(...)
this.webContents.on('move', (event, title) => {
this.webContents.on('move', (event, size) => {
return this.setBounds(size);
});
@ -80,16 +80,16 @@ BrowserWindow.prototype._init = function() {
// Evented visibilityState changes
this.on('show', () => {
return this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', true, this.isMinimized());
return this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', this.isVisible(), this.isMinimized());
});
this.on('hide', () => {
return this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', false, this.isMinimized());
return this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', this.isVisible(), this.isMinimized());
});
this.on('minimize', () => {
return this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', this.isVisible(), true);
return this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', this.isVisible(), this.isMinimized());
});
this.on('restore', () => {
return this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', this.isVisible(), false);
return this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', this.isVisible(), this.isMinimized());
});
// Notify the creation of the window.