From 0925abfd1c8ea889e884b7db4faa93056814f23b Mon Sep 17 00:00:00 2001 From: z0 Date: Tue, 26 Aug 2025 13:43:38 +0300 Subject: [PATCH] Initialize main window with `visible: false` to prevent white flash (#4177) --- apps/app/src/main.rs | 5 +++++ apps/app/tauri.conf.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/app/src/main.rs b/apps/app/src/main.rs index 09723d39f..5799e51ce 100644 --- a/apps/app/src/main.rs +++ b/apps/app/src/main.rs @@ -191,6 +191,11 @@ fn main() { .plugin( tauri_plugin_window_state::Builder::default() .with_filename("app-window-state.json") + // Use *only* POSITION and SIZE state flags, because saving VISIBLE causes the `visible: false` to not take effect + .with_state_flags( + tauri_plugin_window_state::StateFlags::POSITION + | tauri_plugin_window_state::StateFlags::SIZE, + ) .build(), ) .setup(|app| { diff --git a/apps/app/tauri.conf.json b/apps/app/tauri.conf.json index e55ba32be..6075dde24 100644 --- a/apps/app/tauri.conf.json +++ b/apps/app/tauri.conf.json @@ -67,7 +67,7 @@ "width": 1280, "minHeight": 700, "minWidth": 1100, - "visible": true, + "visible": false, "zoomHotkeysEnabled": false, "decorations": false }