From e9132b4489ecd9353181f0d9dc4e2c6da50f8f4f Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Wed, 1 Jul 2026 10:25:16 -0400 Subject: [PATCH] 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 --- src-tauri/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 4cb68b1..0d9cbe7 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -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();