tauri-apps / tauri-apps/plugins-workspace
[window-state] Use macOS window state autosave API
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
Currently, the window state is stored in a `.window-state` file. macOS provides an API to automatically store the window state in `defaults`.
[NSWindow setFrameAutosaveName](https://developer.apple.com/documentation/appkit/nswindow/1419509-setframeautosavename)
When I run `defaults read com.apple.calculator` I get these values:
```
{
LCDStringValueKey = "0.0000000000000000";
"NSWindow Frame Calc_History_Window" = "653 991 227 342 0 0 2560 1417 ";
"NSWindow Frame Calc_Main_Window" = "511 294 232 321 0 0 2560 1417 ";
ViewDefaultsKey = Basic;
ViewPathDefaultsKey = "##BUILTIN##/BasicAndSci.calcview";
}
```
Contributor guide
Assessment
This issue has not been assessed yet.