Skip to content

Commit

Permalink
Save main window maximized state
Browse files Browse the repository at this point in the history
  • Loading branch information
kalimag authored and YoshiRulz committed Sep 13, 2024
1 parent ad73d39 commit ed13e0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/BizHawk.Client.Common/config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public void SetWindowScaleFor(string sysID, int windowScale)
public bool StartFullscreen { get; set; }
public Point? MainWindowPosition { get; set; }
public Size? MainWindowSize { get; set; }
public bool MainWindowMaximized { get; set; }
public bool RunInBackground { get; set; } = true;
public bool AcceptBackgroundInput { get; set; }
public bool AcceptBackgroundInputControllerOnly { get; set; }
Expand Down
6 changes: 6 additions & 0 deletions src/BizHawk.Client.EmuHawk/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ _argParser.SocketAddress is var (socketIP, socketPort)
{
Size = size;
}

if (Config.MainWindowMaximized)
{
WindowState = FormWindowState.Maximized;
}
}

if (Config.MainFormStayOnTop) TopMost = true;
Expand Down Expand Up @@ -2434,6 +2439,7 @@ private void SaveConfig(string path = "")
Config.MainWindowPosition = Location;
Config.MainWindowSize = Size;
}
Config.MainWindowMaximized = WindowState is FormWindowState.Maximized && !_inFullscreen;
}
else
{
Expand Down

0 comments on commit ed13e0e

Please sign in to comment.