diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 2a23f35d..03ccb0a4 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -53,7 +53,7 @@ impl Default for StateFlags { } } -#[derive(Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Deserialize, Serialize, PartialEq)] struct WindowState { width: f64, height: f64, @@ -65,6 +65,21 @@ struct WindowState { fullscreen: bool, } +impl Default for WindowState { + fn default() -> Self { + Self { + width: Default::default(), + height: Default::default(), + x: Default::default(), + y: Default::default(), + maximized: Default::default(), + visible: true, + decorated: true, + fullscreen: Default::default(), + } + } +} + struct WindowStateCache(Arc>>); pub trait AppHandleExt { /// Saves all open windows state to disk @@ -110,7 +125,9 @@ impl WindowExt for Window { if let Some(state) = c.get(self.label()) { // avoid restoring the default zeroed state + dbg!(&*state); if *state == WindowState::default() { + dbg!("asdasd"); return Ok(()); }