Browse Source

restore last window state (position and size) on startup

macvip 1 year ago
parent
commit
a120670785
2 changed files with 2 additions and 0 deletions
  1. 1 0
      src-tauri/Cargo.toml
  2. 1 0
      src-tauri/src/main.rs

+ 1 - 0
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.

+ 1 - 0
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");
 }