mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-06 02:05:20 +08:00
fix: 在windows和linux中,当启动第二个窗口时,呼出已经启动的窗口 (#992)
* fix: 在windows和linux中,当启动第二个窗口时,呼出已经启动的窗口 * prettier code * change
This commit is contained in:
parent
9d18ad51f6
commit
c25a3065e1
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user