feat(native): P5-42 keep webview unthrottled in tray (instant background sync)
Add WebView2 additional_browser_args to disable Chromium background throttling (--disable-background-timer-throttling / -renderer-backgrounding / -backgrounding-occluded-windows) so the existing JS Matrix /sync loop and notifications keep running full-speed when the app is closed to the tray, instead of standing up a second headless Rust sync client. Tauri's default WebView2 args are preserved (setting this overrides them). Windows/WebView2 only; does not block system sleep (that's P5-46, calls-only). CI Windows compile pending. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -494,6 +494,15 @@ pub fn run() {
|
||||
.visible(false)
|
||||
.initialization_script(NOTIFICATION_BRIDGE)
|
||||
.disable_drag_drop_handler()
|
||||
// P5-42: keep the WebView2 renderer running full-speed while the
|
||||
// app is closed to the tray, so the Matrix /sync loop and
|
||||
// notifications aren't throttled/backgrounded by Chromium. Preserves
|
||||
// Tauri's default WebView2 args (setting this overrides them) and
|
||||
// appends the Chromium background-throttling disables. Windows-only
|
||||
// in effect; harmless elsewhere. Does not block system sleep.
|
||||
.additional_browser_args(
|
||||
"--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection --disable-background-timer-throttling --disable-renderer-backgrounding --disable-backgrounding-occluded-windows",
|
||||
)
|
||||
.on_page_load(|window, payload| {
|
||||
if matches!(payload.event(), PageLoadEvent::Finished) {
|
||||
let _ = window.show();
|
||||
|
||||
Reference in New Issue
Block a user