Skip to content

Commit 000b9a7

Browse files
committed
Always get "fresh" bounds for a root layout item
1 parent 94101ad commit 000b9a7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/FubarDev.LayoutEngine.WinForms/HandleElements/HwndLayoutItem.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal IWin32Window RootWindow
3232

3333
public string? Name { get; set; }
3434
public Point Location => Bounds.Location;
35-
public Rectangle Bounds
35+
public virtual Rectangle Bounds
3636
{
3737
get
3838
{
@@ -81,7 +81,7 @@ public void SetBounds(Rectangle bounds)
8181
_bounds = bounds;
8282
}
8383

84-
private static Rectangle GetBounds(IntPtr handle)
84+
protected static Rectangle GetBounds(IntPtr handle)
8585
{
8686
if (!WindowsApi.GetWindowRect(handle, out var rect))
8787
{

src/FubarDev.LayoutEngine.WinForms/HandleElements/HwndLayoutRoot.cs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public HwndLayoutRoot(IWin32Window window)
1919
RootWindow = window;
2020
}
2121

22+
public override Rectangle Bounds => GetBounds(Handle);
23+
2224
public Size ClientSize => GetClientRect(Handle).Size;
2325
public Rectangle DisplayRectangle => GetDisplayRectangle(Handle);
2426

0 commit comments

Comments
 (0)