Skip to content

feat: persist Tauri window state#2377

Open
BillSaul wants to merge 1 commit intofarion1231:mainfrom
BillSaul:feat/window-state-persistence
Open

feat: persist Tauri window state#2377
BillSaul wants to merge 1 commit intofarion1231:mainfrom
BillSaul:feat/window-state-persistence

Conversation

@BillSaul
Copy link
Copy Markdown

Summary / 概述

接入 tauri-plugin-window-state,用于持久化主窗口的位置和大小。

本次改动包含:

  • 新增 tauri-plugin-window-state 依赖并注册插件
  • 在应用主动退出前显式保存窗口状态,避免当前退出流程绕过插件默认退出钩子
  • 在重启应用前保存窗口状态
  • 在进入轻量模式销毁主窗口前保存窗口状态
  • 优化退出轻量模式时的窗口重建流程,避免窗口先以默认大小和位置显示,再跳转到恢复后的位置

Related Issue / 关联 Issue

Fixes #1648

Checklist / 检查清单

  • pnpm typecheck passes / 通过 TypeScript 类型检查
  • pnpm format:check passes / 通过代码格式检查
  • cargo clippy passes (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)

Add the window-state plugin and explicitly save size and position across app exit, restart, and lightweight-mode transitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

希望可以记录窗口大小和位置

1 participant