Skip to content

Commit

Permalink
Do not reapply geometry when maximized
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Jun 14, 2024
1 parent 9e8cf35 commit 68e310e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/UniGetUI/Interface/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,13 @@ private void RestoreGeometry()
Logger.Error(ex);
return;
}

if (IsRectangleFullyVisible(X, Y, Width, Height))

if(State == 1)
{
if (AppWindow.Presenter is OverlappedPresenter presenter) presenter.Maximize();
else Logger.Warn("MainWindow.AppWindow.Presenter is not OverlappedPresenter presenter!");
}
else if (IsRectangleFullyVisible(X, Y, Width, Height))
{
AppWindow.Resize(new Windows.Graphics.SizeInt32(Width, Height));
AppWindow.Move(new Windows.Graphics.PointInt32(X, Y));
Expand All @@ -543,11 +548,7 @@ private void RestoreGeometry()
Logger.Warn("Restored geometry was outside of desktop bounds");
}

if(State == 1)
{
if (AppWindow.Presenter is OverlappedPresenter presenter) presenter.Maximize();
else Logger.Warn("MainWindow.AppWindow.Presenter is not OverlappedPresenter presenter!");
}

}
private bool IsRectangleFullyVisible(int x, int y, int width, int height)
{
Expand Down

0 comments on commit 68e310e

Please sign in to comment.