Skip to content

Commit

Permalink
fix window not restoring on win11
Browse files Browse the repository at this point in the history
  • Loading branch information
34736384 committed Dec 26, 2023
1 parent 31d39dd commit 4a9833e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions unlockfps_nc/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ namespace unlockfps_nc
{
public partial class MainForm : Form
{
private Point _windowLocation;
private Size _windowSize;

private readonly ConfigService _configService;
private readonly Config _config;
private readonly ProcessService _processService;
Expand Down Expand Up @@ -36,6 +39,8 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)

private void MainForm_Load(object sender, EventArgs e)
{
_windowLocation = Location;
_windowSize = Size;
if (_config.AutoStart)
BtnStartGame_Click(null, null);
}
Expand Down Expand Up @@ -94,6 +99,9 @@ private void NotifyIconMain_DoubleClick(object sender, EventArgs e)
ShowInTaskbar = true;
Show();
Activate();

Location = _windowLocation;
Size = _windowSize;
}

private void AboutMenuItem_Click(object sender, EventArgs e)
Expand Down

0 comments on commit 4a9833e

Please sign in to comment.