fix: save window state (#313)

This commit is contained in:
lencx
2023-02-12 00:49:55 +08:00
parent 4cba634d4a
commit 522f7b86b8
3 changed files with 26 additions and 0 deletions

24
Cargo.lock generated
View File

@@ -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"

View File

@@ -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"] }

View File

@@ -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,