mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 桌面端内核进程根据 Electron 主进程判断是否自动退出 Fix https://github.com/siyuan-note/siyuan/issues/7002
This commit is contained in:
parent
f5095ad1b8
commit
3c65021b83
1 changed files with 7 additions and 2 deletions
|
|
@ -38,10 +38,15 @@ func HandleSignal() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func HookDesktopUIProc() {
|
func HookDesktopUIProc() {
|
||||||
if util.ContainerStd != util.Container || "dev" == util.Mode {
|
if util.ContainerStd != util.Container {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uiProcName := "siyuan"
|
||||||
|
if "dev" == util.Mode {
|
||||||
|
uiProcName = "electron"
|
||||||
|
}
|
||||||
|
|
||||||
time.Sleep(30 * time.Second)
|
time.Sleep(30 * time.Second)
|
||||||
existUIProc := false
|
existUIProc := false
|
||||||
for range time.Tick(7 * time.Second) {
|
for range time.Tick(7 * time.Second) {
|
||||||
|
|
@ -58,7 +63,7 @@ func HookDesktopUIProc() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(strings.ToLower(proc.Executable()), "siyuan") {
|
if strings.Contains(strings.ToLower(proc.Executable()), uiProcName) {
|
||||||
existUIProc = true
|
existUIProc = true
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue