Skip to content

Commit

Permalink
Merge branch 'hotfix/2.4.7' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Jul 1, 2021
2 parents 4421322 + c00d8eb commit ee63390
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MahApps.Metro/Behaviors/WindowsSettingBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ private void SaveWindowState()
RECT rect;
if (UnsafeNativeMethods.GetWindowRect(hwnd, out rect))
{
var monitor = NativeMethods.MonitorFromWindow(hwnd, MonitorOptions.MONITOR_DEFAULTTONEAREST);
if (monitor != IntPtr.Zero)
{
var monitorInfo = NativeMethods.GetMonitorInfo(monitor);
rect.Offset(monitorInfo.rcMonitor.Left - monitorInfo.rcWork.Left, monitorInfo.rcMonitor.Top - monitorInfo.rcWork.Top);
}

wp.normalPosition = rect;
}
}
Expand Down

0 comments on commit ee63390

Please sign in to comment.