|
@@ -18,20 +18,17 @@ if (!gotTheLock) {
|
|
|
logger.info(`app quit => gotTheLock:${gotTheLock}`);
|
|
|
app.quit();
|
|
|
} else {
|
|
|
- app.on("ready", async () => {
|
|
|
- if (isDev) {
|
|
|
- try {
|
|
|
- await installExtension(VUEJS3_DEVTOOLS);
|
|
|
- } catch (e: any) {
|
|
|
- console.error("Vue Devtools failed to install:", e.toString());
|
|
|
+ app.on(
|
|
|
+ "second-instance",
|
|
|
+ (event, commandLine, workingDirectory, additionalData) => {
|
|
|
+ if (win) {
|
|
|
+ if (win.isMinimized()) win.restore();
|
|
|
+ //监听第二次双击进入应用程序的操作,如果本窗口是hide状态,并不会自动显示出来,而且会在任务管理器的后台进程里多好几个进程名
|
|
|
+ //于是需要在监听回调里,做激活显示本窗口的操作
|
|
|
+ win.show();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- logger.info(`app ready`);
|
|
|
- registEvent();
|
|
|
-
|
|
|
- createWin();
|
|
|
- });
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
function createWin() {
|
|
@@ -211,3 +208,18 @@ function registEvent() {
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+app.on("ready", async () => {
|
|
|
+ if (isDev) {
|
|
|
+ try {
|
|
|
+ await installExtension(VUEJS3_DEVTOOLS);
|
|
|
+ } catch (e: any) {
|
|
|
+ console.error("Vue Devtools failed to install:", e.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ logger.info(`app ready`);
|
|
|
+ registEvent();
|
|
|
+
|
|
|
+ createWin();
|
|
|
+});
|