File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 22All notable changes to this project will be documented in this file.
33This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
44
5+ ## 0.5.5 - 2017-11-10
6+ * Fix window (and linux?) lifecycle bug
7+
58## 0.5.4 - 2017-11-10
69* Update choo devtools
710* Remove choo log
Original file line number Diff line number Diff line change @@ -35,6 +35,22 @@ var al = new AudioLibrary(libraryPersist.store)
3535module . exports = state
3636module . exports . al = al
3737
38+ var shouldQuit = app . makeSingleInstance ( function ( commandLine , workingDirectory ) {
39+ // https://github.com/electron/electron/blob/v0.36.10/docs/api/app.md#appmakesingleinstancecallback
40+ // Someone tried to run a second instance, we should focus our window.
41+ if ( player . win ) {
42+ if ( player . win . isMinimized ( ) ) player . win . restore ( )
43+ player . win . focus ( )
44+ } else {
45+ al . recall ( )
46+ player . init ( )
47+ }
48+ } )
49+
50+ if ( shouldQuit ) {
51+ app . exit ( )
52+ }
53+
3854app . on ( 'ready' , function appReady ( ) {
3955 menu . init ( )
4056 audio . init ( )
@@ -215,6 +231,13 @@ app.on('ready', function appReady () {
215231 setTimeout ( ( ) => {
216232 autoUpdater . checkForUpdatesAndNotify ( )
217233 } , 500 )
234+
235+ if ( process . platform !== 'darwin' ) { // TODO System tray on windows (maybe linux)
236+ // since window-all-closed doesn't fire with our hidden audio process
237+ player . win . once ( 'closed' , ( ) => {
238+ app . quit ( )
239+ } )
240+ }
218241} )
219242
220243autoUpdater . on ( 'error' , ( err ) => {
@@ -249,10 +272,6 @@ autoUpdater.on('update-downloaded', (info) => {
249272 console . log ( info )
250273} )
251274
252- app . on ( 'window-all-closed' , function allWindowsClosed ( ) {
253- if ( process . platform !== 'darwin' ) app . quit ( )
254- } )
255-
256275app . on ( 'activate' , function activate ( ) {
257276 if ( player . win === null ) {
258277 al . recall ( )
You can’t perform that action at this time.
0 commit comments