From 48f894d5a0a86bd12277356c742947ce34409af2 Mon Sep 17 00:00:00 2001 From: vczh Date: Sun, 3 Jul 2022 13:17:04 -0700 Subject: [PATCH] https://github.com/vczh-libraries/GacUI/issues/79 --- Import/GacUI.Windows.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Import/GacUI.Windows.cpp b/Import/GacUI.Windows.cpp index 69cbb591..e83d3fa5 100644 --- a/Import/GacUI.Windows.cpp +++ b/Import/GacUI.Windows.cpp @@ -9199,11 +9199,20 @@ WindowsForm void SetClientSize(NativeSize size)override { - RECT required={0,0,(int)size.x.value,(int)size.y.value }; - RECT bounds; - GetWindowRect(handle, &bounds); - DpiAwared_AdjustWindowRect(&required, handle, dpiX); - SetBounds(NativeRect(NativePoint(bounds.left, bounds.top), NativeSize(required.right-required.left, required.bottom-required.top))); + if (customFrameMode) + { + RECT bounds; + GetWindowRect(handle, &bounds); + SetBounds(NativeRect(NativePoint(bounds.left, bounds.top), size)); + } + else + { + RECT required = { 0,0,(int)size.x.value,(int)size.y.value }; + RECT bounds; + GetWindowRect(handle, &bounds); + DpiAwared_AdjustWindowRect(&required, handle, dpiX); + SetBounds(NativeRect(NativePoint(bounds.left, bounds.top), NativeSize(required.right - required.left, required.bottom - required.top))); + } } NativeRect GetClientBoundsInScreen()override