[try3 5/5] user32: Fixed minTrack for thick childs.
Florian Köberle
florian at fkoeberle.de
Wed Nov 19 04:07:03 CST 2008
---
dlls/user32/tests/win.c | 15 ++++++---------
dlls/user32/winpos.c | 9 +++++++--
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index ee24159..7cdba26 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -5162,10 +5162,9 @@ static LRESULT WINAPI test_thick_child_size_winproc(HWND hwnd, UINT msg, WPARAM
expectedMinTrack = 2* getExpectedThickChildInc();
actualMinTrackX = minmax->ptMinTrackSize.x;
actualMinTrackY = minmax->ptMinTrackSize.y;
- todo_wine
- ok(actualMinTrackX == expectedMinTrack && actualMinTrackY == expectedMinTrack,
- "expected minTrack %dx%d, actual minTrack %dx%d\n",
- expectedMinTrack, expectedMinTrack, actualMinTrackX, actualMinTrackY);
+ ok(actualMinTrackX == expectedMinTrack && actualMinTrackY == expectedMinTrack,
+ "expected minTrack %dx%d, actual minTrack %dx%d\n",
+ expectedMinTrack, expectedMinTrack, actualMinTrackX, actualMinTrackY);
actualMaxTrackX = minmax->ptMaxTrackSize.x;
actualMaxTrackY = minmax->ptMaxTrackSize.y;
@@ -5240,11 +5239,9 @@ static void test_thick_child_size(HWND parentWindow) {
childWidth = childRect.right - childRect.left;
childHeight = childRect.bottom - childRect.top;
- todo_wine
- ok( (childWidth == expectedSize) && (childHeight == expectedSize),
- "size of window with style WS_CHILD | WS_VISIBLE | WS_THICKFRAME is wrong: expected size %dx%d != actual size %dx%d\n",
- expectedSize, expectedSize, childWidth, childHeight);
-
+ ok( (childWidth == expectedSize) && (childHeight == expectedSize),
+ "size of window with style WS_CHILD | WS_VISIBLE | WS_THICKFRAME is wrong: expected size %dx%d != actual size %dx%d\n",
+ expectedSize, expectedSize, childWidth, childHeight);
SetLastError(0xdeadbeef);
success = DestroyWindow(childWindow);
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 4f0c99f..8892ecf 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -658,6 +658,8 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
LONG exstyle = GetWindowLongW( hwnd, GWL_EXSTYLE );
RECT rc;
WND *win;
+ const int outer = 2;
+ int resizeBorder;
/* Compute default values */
@@ -673,10 +675,13 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
GetClientRect(GetAncestor(hwnd,GA_PARENT), &rc);
AdjustWindowRectEx(&rc, style, ((style & WS_POPUP) && GetMenu(hwnd)), exstyle);
+ resizeBorder = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXDLGFRAME);
+ xinc = yinc = outer + resizeBorder;
+
MinMax.ptMaxSize.x = rc.right - rc.left;
MinMax.ptMaxSize.y = rc.bottom - rc.top;
- MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK);
- MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK);
+ MinMax.ptMinTrackSize.x = 2*xinc;
+ MinMax.ptMinTrackSize.y = 2*yinc;
MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXMAXTRACK);
MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYMAXTRACK);
MinMax.ptMaxPosition.x = 0;
--
1.6.0.4
More information about the wine-patches
mailing list