Skip to content

Commit

Permalink
do not save window state when window is minimized
Browse files Browse the repository at this point in the history
this happens when the window is minimized on Windows. Restoring the
window size causes the application not available since the window size
is zero.
  • Loading branch information
rhysd committed Jun 6, 2024
1 parent 7a2244e commit 7c7add4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions v2/src/shiba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,10 @@ where
let data_dir = self.config.data_dir();
if self.config.window().restore {
if let Some(state) = self.renderer.window_state() {
log::debug!("Saving window state as persistent data: {:?}", state);
data_dir.save(&state)?;
if state.height > 0 && state.width > 0 {
log::debug!("Saving window state as persistent data: {:?}", state);
data_dir.save(&state)?;
}
}
}
data_dir.save_recent_files(self.history.iter(), self.config.max_recent_files())?;
Expand Down

0 comments on commit 7c7add4

Please sign in to comment.