From a1206707853674bb53f12246c7f285ac850deef0 Mon Sep 17 00:00:00 2001 From: macvip Date: Tue, 20 Jun 2023 13:06:54 +0800 Subject: [PATCH] restore last window state (position and size) on startup --- src-tauri/Cargo.toml | 1 + src-tauri/src/main.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 4d160816c38..694f62cb610 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -18,6 +18,7 @@ tauri-build = { version = "1.3.0", features = [] } serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } tauri = { version = "1.3.0", features = ["clipboard-all", "shell-open", "updater", "window-close", "window-hide", "window-maximize", "window-minimize", "window-set-icon", "window-set-ignore-cursor-events", "window-set-resizable", "window-show", "window-start-dragging", "window-unmaximize", "window-unminimize"] } +tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } [features] # this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled. diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f5c5be2365b..ed3ec32f37b 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -3,6 +3,7 @@ fn main() { tauri::Builder::default() + .plugin(tauri_plugin_window_state::Builder::default().build()) .run(tauri::generate_context!()) .expect("error while running tauri application"); }