Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions MahApps.Metro/Microsoft.Windows.Shell/WindowChromeWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,14 +1134,21 @@ private void _ClearRoundingRegion()
NativeMethods.SetWindowRgn(_hwnd, IntPtr.Zero, NativeMethods.IsWindowVisible(_hwnd));
}

private static RECT _GetClientRectRelativeToWindowRect(IntPtr hWnd)
private RECT _GetClientRectRelativeToWindowRect(IntPtr hWnd)
{
RECT windowRect = NativeMethods.GetWindowRect(hWnd);
RECT clientRect = NativeMethods.GetClientRect(hWnd);

POINT test = new POINT() { x = 0, y = 0 };
NativeMethods.ClientToScreen(hWnd, ref test);
clientRect.Offset(test.x - windowRect.Left, test.y - windowRect.Top);
if (_window.FlowDirection == FlowDirection.RightToLeft)
{
clientRect.Offset(windowRect.Right - test.x, test.y - windowRect.Top);
}
else
{
clientRect.Offset(test.x - windowRect.Left, test.y - windowRect.Top);
}
return clientRect;
}

Expand Down