mirror of
https://gitee.com/energye/energy.git
synced 2024-11-30 10:47:57 +08:00
upgrade-dev v2.2.7
This commit is contained in:
parent
1d1f42519a
commit
549d754b6d
@ -59,9 +59,11 @@ func Run(app *TCEFApplication) {
|
||||
logger.Debug("application process [", common.Args.ProcessType(), "] run end")
|
||||
api.EnergyLibRelease()
|
||||
}()
|
||||
//ipc初始化
|
||||
ipcInit()
|
||||
//MacOSX 多进程时,需要调用StartSubProcess来启动子进程
|
||||
if common.IsDarwin() && !consts.SingleProcess && !common.Args.IsMain() {
|
||||
// mac os 启动子进程
|
||||
// 启动子进程
|
||||
app.StartSubProcess()
|
||||
app.Free()
|
||||
} else {
|
||||
@ -70,25 +72,26 @@ func Run(app *TCEFApplication) {
|
||||
mtml := app.MultiThreadedMessageLoop()
|
||||
consts.IsMessageLoop = !emp && !mtml
|
||||
if consts.IsMessageLoop {
|
||||
//启用VF窗口组件
|
||||
// 启用VF窗口组件
|
||||
BrowserWindow.appContextInitialized(app)
|
||||
}
|
||||
//启动主进程
|
||||
// 启动主进程
|
||||
success := app.StartMainProcess()
|
||||
//主进程启动成功之后回调
|
||||
// 主进程启动成功之后回调
|
||||
if browserProcessStartAfterCallback != nil {
|
||||
browserProcessStartAfterCallback(success)
|
||||
}
|
||||
if success {
|
||||
appMainRunCallback()
|
||||
if consts.IsMessageLoop {
|
||||
//VF窗口消息轮询
|
||||
// VF窗口消息轮询
|
||||
app.RunMessageLoop()
|
||||
} else {
|
||||
//LCL窗口组件
|
||||
// 创建LCL窗口组件
|
||||
if BrowserWindow.mainBrowserWindow == nil {
|
||||
BrowserWindow.mainBrowserWindow = &lclBrowserWindow{}
|
||||
}
|
||||
// 运行主窗口
|
||||
lcl.RunApp(&BrowserWindow.mainBrowserWindow)
|
||||
}
|
||||
}
|
||||
|
@ -55,14 +55,23 @@ type ipcCallback struct {
|
||||
function *ICefV8Value
|
||||
}
|
||||
|
||||
func init() {
|
||||
if common.Args.IsMain() {
|
||||
} else if common.Args.IsRender() {
|
||||
}
|
||||
ipcBrowser = &ipcBrowserProcess{}
|
||||
ipcRender = &ipcRenderProcess{
|
||||
ipcEmit: &ipcEmitHandler{callbackList: make(map[int32]*ipcCallback, 256)},
|
||||
ipcOn: &ipcOnHandler{callbackList: make(map[string]*ipcCallback)},
|
||||
// ipcInit 初始化
|
||||
func ipcInit() {
|
||||
if application.SingleProcess() {
|
||||
ipcBrowser = &ipcBrowserProcess{}
|
||||
ipcRender = &ipcRenderProcess{
|
||||
ipcEmit: &ipcEmitHandler{callbackList: make(map[int32]*ipcCallback)},
|
||||
ipcOn: &ipcOnHandler{callbackList: make(map[string]*ipcCallback)},
|
||||
}
|
||||
} else {
|
||||
if common.Args.IsMain() {
|
||||
ipcBrowser = &ipcBrowserProcess{}
|
||||
} else if common.Args.IsRender() {
|
||||
ipcRender = &ipcRenderProcess{
|
||||
ipcEmit: &ipcEmitHandler{callbackList: make(map[int32]*ipcCallback)},
|
||||
ipcOn: &ipcOnHandler{callbackList: make(map[string]*ipcCallback)},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user