mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
fix(window-state): restore window state for stubbed zerord state (#1259)
* Restore window state for default state * Add change file
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": patch
|
||||
---
|
||||
|
||||
Fix `restore_window` doesn't work with `skip_initial_state` when no previous cache was found
|
||||
@@ -148,12 +148,10 @@ impl<R: Runtime> WindowExt for Window<R> {
|
||||
|
||||
let mut should_show = true;
|
||||
|
||||
if let Some(state) = c.get(self.label()) {
|
||||
// avoid restoring the default zeroed state
|
||||
if *state == WindowState::default() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if let Some(state) = c
|
||||
.get(self.label())
|
||||
.filter(|state| state != &&WindowState::default())
|
||||
{
|
||||
if flags.contains(StateFlags::DECORATIONS) {
|
||||
self.set_decorations(state.decorated)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user