diff --git a/Cargo.lock b/Cargo.lock index 91bd2ee..5a79193 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -212,6 +212,15 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -407,6 +416,7 @@ dependencies = [ "tauri-plugin-autostart", "tauri-plugin-log", "tauri-plugin-positioner", + "tauri-plugin-window-state", "thiserror", "tokio", "walkdir", @@ -3442,6 +3452,20 @@ dependencies = [ "tauri", ] +[[package]] +name = "tauri-plugin-window-state" +version = "0.1.0" +source = "git+https://github.com/lencx/tauri-plugins-workspace?branch=dev#bf1106a0a5e178ce38ecde56751ba037307a7ae8" +dependencies = [ + "bincode", + "bitflags", + "log", + "serde", + "serde_json", + "tauri", + "thiserror", +] + [[package]] name = "tauri-runtime" version = "0.12.1" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index f0f4147..d1bf8aa 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -30,6 +30,7 @@ tauri = { version = "1.2.4", features = ["api-all", "devtools", "global-shortcut tauri-plugin-positioner = { version = "1.0.4", features = ["system-tray"] } tauri-plugin-log = { git = "https://github.com/lencx/tauri-plugins-workspace", branch = "dev", features = ["colored"] } tauri-plugin-autostart = { git = "https://github.com/lencx/tauri-plugins-workspace", branch = "dev" } +tauri-plugin-window-state = { git = "https://github.com/lencx/tauri-plugins-workspace", branch = "dev" } # sqlx = { version = "0.6.2", features = ["runtime-tokio-rustls", "sqlite"] } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 01c042f..e7a9a11 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -52,6 +52,7 @@ async fn main() { MacosLauncher::LaunchAgent, None, )) + .plugin(tauri_plugin_window_state::Builder::default().build()) .invoke_handler(tauri::generate_handler![ cmd::drag_window, cmd::fullscreen,