diff --git a/src/background.js b/src/background.js index 5f2946d..5efde71 100644 --- a/src/background.js +++ b/src/background.js @@ -86,7 +86,7 @@ class Background { }); this.neteaseMusicAPI = null; this.expressApp = null; - this.willQuitApp = isMac ? false : true; + this.willQuitApp = !isMac; this.init(); } @@ -387,6 +387,18 @@ class Background { // unregister all global shortcuts globalShortcut.unregisterAll(); }); + + if (!isMac) { + app.on('second-instance', (e, cl, wd) => { + if (this.window) { + this.window.show(); + if (this.window.isMinimized()) { + this.window.restore(); + } + this.window.focus(); + } + }); + } } }