From a0d5dfaed113a3fea0e70f1879f46baa31178cd0 Mon Sep 17 00:00:00 2001 From: PiEgg Date: Mon, 17 Aug 2026 14:59:09 +0800 Subject: [PATCH] :bug: Fix(gui): make backgroundThrottling optional in window options type #1435 removed `backgroundThrottling: false` from `defaultWebPreferences`, but `IBrowserWindowOptions.webPreferences` still declared the field as required, so `tsc` failed on all five window definitions. Mark it optional rather than dropping it: omitting the field keeps Electron's default (throttle when hidden), which is what #1435 intended, while individual windows can still opt out explicitly if they ever need full-speed background rendering. --- src/universal/types/types.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/universal/types/types.d.ts b/src/universal/types/types.d.ts index 5fd7dd8..3b12140 100644 --- a/src/universal/types/types.d.ts +++ b/src/universal/types/types.d.ts @@ -144,7 +144,8 @@ interface IBrowserWindowOptions { nodeIntegration: boolean, nodeIntegrationInWorker: boolean, contextIsolation: boolean, - backgroundThrottling: boolean + // 不传即沿用 Electron 默认值(true,窗口不可见时降频);仅在某个窗口确实需要后台全速渲染时才显式关闭。 + backgroundThrottling?: boolean webSecurity?: boolean }, vibrancy?: string | any,