From ed13e0ef24b74e8a7944069a0bcf2369fbd36683 Mon Sep 17 00:00:00 2001 From: kalimag Date: Thu, 12 Sep 2024 17:49:21 +0200 Subject: [PATCH] Save main window maximized state --- src/BizHawk.Client.Common/config/Config.cs | 1 + src/BizHawk.Client.EmuHawk/MainForm.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/BizHawk.Client.Common/config/Config.cs b/src/BizHawk.Client.Common/config/Config.cs index 15316b74a2..978734440c 100644 --- a/src/BizHawk.Client.Common/config/Config.cs +++ b/src/BizHawk.Client.Common/config/Config.cs @@ -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; } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 90caf6fc45..c134afc667 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -610,6 +610,11 @@ _argParser.SocketAddress is var (socketIP, socketPort) { Size = size; } + + if (Config.MainWindowMaximized) + { + WindowState = FormWindowState.Maximized; + } } if (Config.MainFormStayOnTop) TopMost = true; @@ -2434,6 +2439,7 @@ private void SaveConfig(string path = "") Config.MainWindowPosition = Location; Config.MainWindowSize = Size; } + Config.MainWindowMaximized = WindowState is FormWindowState.Maximized && !_inFullscreen; } else {