mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-05 05:39:33 +08:00
fix(desktop): show the macOS window after the first shell paint
This commit is contained in:
@@ -844,7 +844,12 @@ function buildMenu() {
|
||||
|
||||
if (!app.requestSingleInstanceLock()) { app.quit(); }
|
||||
else {
|
||||
app.on('second-instance', () => { window?.show(); window?.focus(); });
|
||||
let shellReady = process.platform !== 'darwin';
|
||||
app.on('second-instance', () => {
|
||||
if (!shellReady || quitting) return;
|
||||
window?.show();
|
||||
window?.focus();
|
||||
});
|
||||
app.on('before-quit', event => {
|
||||
if (exitAllowed) return;
|
||||
event.preventDefault();
|
||||
@@ -870,6 +875,7 @@ else {
|
||||
callback(result.response === 1);
|
||||
});
|
||||
window = new BrowserWindow({
|
||||
show: shellReady,
|
||||
title: 'Open DeepTutor', width: 1360, height: 920, minWidth: 900, minHeight: 620,
|
||||
backgroundColor: currentChromeBackground(),
|
||||
...(WINDOWS
|
||||
@@ -903,6 +909,12 @@ else {
|
||||
})) ipcMain.handle(`desktop:${channel}`, (event, ...args) => { trustedShell(event); return handler(...args); });
|
||||
buildMenu();
|
||||
watchInterface();
|
||||
if (!shellReady) {
|
||||
window.once('ready-to-show', () => {
|
||||
shellReady = true;
|
||||
if (!quitting) window.show();
|
||||
});
|
||||
}
|
||||
await window.loadURL(shellURL);
|
||||
void boot();
|
||||
}).catch(async error => {
|
||||
|
||||
Reference in New Issue
Block a user