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:
Tony
2024-04-30 00:33:33 +08:00
committed by GitHub
parent 04ebd0282e
commit 44e47fe98b
2 changed files with 9 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"window-state": patch
---
Fix `restore_window` doesn't work with `skip_initial_state` when no previous cache was found
+4 -6
View File
@@ -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)?;
}