tauri-apps / tauri-apps/plugins-workspace

[window-state] Use macOS window state autosave API

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
platform: macos plugin: window-state status: help wanted type: feature request
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.