diff --git a/.changes/restore-default-window-state.md b/.changes/restore-default-window-state.md new file mode 100644 index 00000000..d0a954db --- /dev/null +++ b/.changes/restore-default-window-state.md @@ -0,0 +1,5 @@ +--- +"window-state": patch +--- + +Fix `restore_window` doesn't work with `skip_initial_state` when no previous cache was found diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 7235a93a..75798a8f 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -148,12 +148,10 @@ impl WindowExt for Window { 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)?; }