diff --git a/GUI.NET/Config/Configuration.cs b/GUI.NET/Config/Configuration.cs index 297bc8ab..163d0ac3 100644 --- a/GUI.NET/Config/Configuration.cs +++ b/GUI.NET/Config/Configuration.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.IO; using System.Linq; using System.Text; @@ -29,6 +30,7 @@ namespace Mesen.GUI.Config public PlayerProfile Profile; public DebugInfo DebugInfo; public AviRecordInfo AviRecordInfo; + public Point? WindowLocation; public Configuration() { diff --git a/GUI.NET/Forms/frmMain.cs b/GUI.NET/Forms/frmMain.cs index 1ab6b544..ff65e088 100644 --- a/GUI.NET/Forms/frmMain.cs +++ b/GUI.NET/Forms/frmMain.cs @@ -48,6 +48,11 @@ namespace Mesen.GUI.Forms { InitializeComponent(); + if(ConfigManager.Config.WindowLocation.HasValue) { + this.StartPosition = FormStartPosition.Manual; + this.Location = ConfigManager.Config.WindowLocation.Value; + } + _commandLineArgs = args; Application.AddMessageFilter(this); @@ -175,6 +180,11 @@ namespace Mesen.GUI.Forms ConfigManager.Config.EmulationInfo.EmulationSpeed = InteropEmu.GetEmulationSpeed(); ConfigManager.Config.VideoInfo.VideoScale = _regularScale; + if(this.WindowState == FormWindowState.Normal) { + ConfigManager.Config.WindowLocation = this.Location; + } else { + ConfigManager.Config.WindowLocation = this.RestoreBounds.Location; + } ConfigManager.ApplyChanges(); StopEmu();