Tauri Plugin Window State

Test

This plugin provides a Tauri Plugin that saves the window position and size and restores it when the app is reopened.

Installation

There are three general methods of installation that we can recommend. 1. Pull sources directly from Github using git tags / revision hashes (most secure, good for developement, shown below) 2. Git submodule install this repo in your tauri project and then use file protocol to ingest the source 3. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)

For more details and usage see the example app. Please note, below in the dependencies you can also lock to a revision/tag in the Cargo.toml.

src-tauri/Cargo.toml yaml [dependencies] tauri = "1.0" tauri-plugin-window-state = "0.1"

Use in src-tauri/src/main.rs: rust fn main() { tauri::Builder::default() .plugin(tauri_plugin_window_state::Builder::default().build()) .run(); }

To prevent flashes when the window is updated, the window visible property must be set to false. The plugin is responsible for showing it after restoring its state.

License

MIT / Apache-2.0