🐛 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.
This commit is contained in:
PiEgg
2026-08-17 14:59:09 +08:00
parent 45fd078e4e
commit a0d5dfaed1
+2 -1
View File
@@ -144,7 +144,8 @@ interface IBrowserWindowOptions {
nodeIntegration: boolean,
nodeIntegrationInWorker: boolean,
contextIsolation: boolean,
backgroundThrottling: boolean
// 不传即沿用 Electron 默认值(true,窗口不可见时降频);仅在某个窗口确实需要后台全速渲染时才显式关闭。
backgroundThrottling?: boolean
webSecurity?: boolean
},
vibrancy?: string | any,