fix: unblock startup on network and external font

- Make license status snapshot non-blocking (revocation check in background)

- Speed boot by not awaiting license network and capping editor ready wait

- Stop disabling GPU by default on Win packaged builds

- Remove external font fetch; bundle local Inter

Made-with: Cursor
This commit is contained in:
Ivan Fontosh
2026-04-20 16:28:17 +08:00
parent e39a72206d
commit 2ce1e02753
7 changed files with 54 additions and 18 deletions
+13 -10
View File
@@ -28,10 +28,10 @@ import {
} from './windows/createWindows';
/**
* На части конфигураций Windows окно Electron с `file://` остаётся чёрным из‑за GPU/композитора.
* Отключаем аппаратное ускорение в упакованном приложении; отключить обход: `DND_DISABLE_GPU=0`.
* Отключение GPU ломает скорость вторичных окон (презентация/пульт — WebGL). По умолчанию не трогаем.
* При чёрном экране в упакованной сборке: `DND_DISABLE_GPU=1`.
*/
if (process.platform === 'win32' && app.isPackaged && process.env.DND_DISABLE_GPU !== '0') {
if (process.platform === 'win32' && app.isPackaged && process.env.DND_DISABLE_GPU === '1') {
app.disableHardwareAcceleration();
}
@@ -144,17 +144,20 @@ async function runStartupAfterHandlers(licenseService: LicenseService): Promise<
console.error('[boot] ensureRoots', e);
}
setBootWindowStatus(splash, 'Устанавливаем связь…');
setBootWindowStatus(splash, 'Проверка лицензии…');
try {
await licenseService.getStatus();
} catch (e) {
console.error('[boot] license getStatus', e);
}
// Сеть в `getStatus()` не блокируем старт: синхронный снимок, отзыв — в фоне.
licenseService.getStatusSync();
queueMicrotask(() => {
licenseService.getStatus();
});
setBootWindowStatus(splash, 'Загрузка редактора…');
const editor = createEditorWindowDeferred();
await waitForEditorWindowReady(editor);
const bootEditorMs = 2000;
await Promise.race([
waitForEditorWindowReady(editor),
new Promise<void>((resolve) => setTimeout(resolve, bootEditorMs)),
]);
setBootWindowStatus(splash, 'Готово');
destroyBootWindow(splash);
if (!editor.isDestroyed()) {