Finalized browser-window show & hide events, added tests & fixed os x implementation
This commit is contained in:
parent
c1267b2320
commit
fcc1f4d7ed
4 changed files with 73 additions and 9 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue