Skip to content

Commit

Permalink
remove workaround for macos and don't save current size for maximized…
Browse files Browse the repository at this point in the history
… windows
  • Loading branch information
Doublonmousse committed Jun 7, 2024
1 parent 02d8052 commit a6bbdbc
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions crates/rnote-ui/src/appwindow/appsettings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,6 @@ impl RnAppWindow {
let is_maximized = app_settings.boolean("is-maximized");

if is_maximized {
// don't restore maximized window state on macos, avoids issues discussed in
// issue 823 - https://github.com/flxzt/rnote/issues/823
#[cfg(not(target_os = "macos"))]
self.maximize();
} else {
self.set_default_size(window_width, window_height);
Expand Down Expand Up @@ -446,9 +443,17 @@ impl RnAppWindow {

{
// Appwindow
app_settings.set_int("window-width", self.width())?;
app_settings.set_int("window-height", self.height())?;
app_settings.set_boolean("is-maximized", self.is_maximized())?;
match self.is_maximized() {
false => {
app_settings.set_int("window-width", self.width())?;
app_settings.set_int("window-height", self.height())?;
app_settings.set_boolean("is-maximized", self.is_maximized())?;
}
true => {
// this way we don't force the window to be the same size as the last maximized window
app_settings.set_boolean("is-maximized", self.is_maximized())?;
}
}
}

{
Expand Down

0 comments on commit a6bbdbc

Please sign in to comment.