diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index daa539f8..969cf7f8 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -443,6 +443,15 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bincode" version = "2.0.0-rc.3" @@ -1368,7 +1377,7 @@ name = "en-croissant" version = "0.11.0" dependencies = [ "axum", - "bincode", + "bincode 2.0.0-rc.3", "btoi", "bzip2", "chrono", @@ -1399,6 +1408,7 @@ dependencies = [ "tauri", "tauri-build", "tauri-plugin-log", + "tauri-plugin-window-state", "tauri-specta", "tempfile", "thiserror", @@ -5204,7 +5214,7 @@ dependencies = [ [[package]] name = "tauri-plugin-log" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#d95a1b382f512a0be748e7a89e0f8fc4278010e2" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#677bade9089f2963e5858cc5062e5504787eaf7f" dependencies = [ "byte-unit", "fern", @@ -5216,6 +5226,20 @@ dependencies = [ "time", ] +[[package]] +name = "tauri-plugin-window-state" +version = "0.1.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#677bade9089f2963e5858cc5062e5504787eaf7f" +dependencies = [ + "bincode 1.3.3", + "bitflags 2.4.2", + "log", + "serde", + "serde_json", + "tauri", + "thiserror", +] + [[package]] name = "tauri-runtime" version = "0.14.2" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d8c28167..5961869e 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -59,6 +59,7 @@ sysinfo = "0.29.10" window-shadows = "0.2.2" governor = "0.6.3" nonzero_ext = "0.3.0" +tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } [features] # by default Tauri runs in production mode diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 1fccb656..08668df1 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -106,11 +106,6 @@ const REQUIRED_FILES: &[(BaseDirectory, &str, &str)] = #[tauri::command] #[specta::specta] async fn close_splashscreen(window: Window) -> Result<(), String> { - window - .get_window("main") - .expect("no window labeled 'main' found") - .maximize() - .unwrap(); window .get_window("main") .expect("no window labeled 'main' found") @@ -289,6 +284,7 @@ fn main() { delete_empty_games, export_to_pgn ]) + .plugin(tauri_plugin_window_state::Builder::default().build()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6de7f915..0add1c48 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -47,8 +47,7 @@ "minimize": true, "unmaximize": true, "unminimize": true, - "startDragging": true, - "setFullscreen": true + "startDragging": true } }, "bundle": { @@ -101,9 +100,10 @@ "windows": [ { "title": "En Croissant", - "maximized": true, "visible": false, - "decorations": false + "decorations": false, + "minWidth": 820, + "minHeight": 620 } ], "cli": { @@ -116,4 +116,4 @@ ] } } -} \ No newline at end of file +}