Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

fix: exclude FULLSCREEN from window state tracking when not using --fullscreen

ekishionaad510fd723b
diff --git a/src-tauri/src/app/setup.rs b/src-tauri/src/app/setup.rs
index b94ff571..8fc4aaaa 100644
--- a/src-tauri/src/app/setup.rs
+++ b/src-tauri/src/app/setup.rs
@@ -61,7 +61,12 @@ pub fn set_system_tray(
}
}
"quit" => {
- let _ = app.save_window_state(StateFlags::all());
+ let flags = if _init_fullscreen {
+ StateFlags::all()
+ } else {
+ StateFlags::all() & !StateFlags::FULLSCREEN
+ };
+ let _ = app.save_window_state(flags);
app.exit(0);
}
_ => (),
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 76776b53..77f64e84 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -155,7 +155,9 @@ pub fn run_app() {
StateFlags::FULLSCREEN
} else {
// Prevent flickering on the first open.
- StateFlags::all() & !StateFlags::VISIBLE
+ // Exclude FULLSCREEN so a prior --fullscreen build's persisted state
+ // doesn't force fullscreen on a rebuild without --fullscreen.
+ StateFlags::all() & !StateFlags::VISIBLE & !StateFlags::FULLSCREEN
})
.build();