Cache browser visibility state & emit visibilitychange event on change
Fixes #3788
This commit is contained in:
		
					parent
					
						
							
								377a8eefb2
							
						
					
				
			
			
				commit
				
					
						ee61ab2d26
					
				
			
		
					 4 changed files with 35 additions and 12 deletions
				
			
		|  | @ -88,6 +88,18 @@ BrowserWindow.prototype._init = function() { | |||
|     }; | ||||
|   })(this)); | ||||
| 
 | ||||
|   // Evented visibilityState changes
 | ||||
|   this.on('minimize', (function(_this) { | ||||
|     return function() { | ||||
|       return _this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', false); | ||||
|     }; | ||||
|   })(this)); | ||||
|   this.on('restore', (function(_this) { | ||||
|     return function() { | ||||
|       return _this.webContents.send('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', true); | ||||
|     }; | ||||
|   })(this)); | ||||
| 
 | ||||
|   // Notify the creation of the window.
 | ||||
|   app.emit('browser-window-created', {}, this); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Arek Sredzki
				Arek Sredzki