From a7123964a793481221305e5961ab3006bdb81569 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 14 Jul 2008 16:51:15 -0700 Subject: [PATCH 2/2] user32: Clamp newly created windows to the minimum window size. --- dlls/user32/tests/msg.c | 6 +++--- dlls/user32/win.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index d79b2c4..c2012d5 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -3374,7 +3374,7 @@ static void test_mdi_messages(void) 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, mdi_client, 0, GetModuleHandleA(0), NULL); assert(mdi_child2); - ok_sequence(WmCreateMDIchildInvisibleMaxSeq4, "Create maximized invisible MDI child window", TRUE); + ok_sequence(WmCreateMDIchildInvisibleMaxSeq4, "Create maximized invisible MDI child window", FALSE); ok(IsZoomed(mdi_child2), "MDI child should be maximized\n"); ok(!(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE), "MDI child should be not visible\n"); ok(!IsWindowVisible(mdi_child2), "MDI child should be not visible\n"); @@ -4577,10 +4577,10 @@ static void test_setwindowpos(void) NULL, NULL, 0); GetWindowRect(hwnd, &rc); - todo_wine expect(sysX, rc.right); + expect(sysX, rc.right); expect(winY, rc.bottom); GetClientRect(hwnd, &rc); - todo_wine expect(sysX - 6, rc.right); + expect(sysX - 6, rc.right); expect(winY - 25, rc.bottom); flush_events(); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 9a97a3a..2b7f620 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -1165,6 +1165,8 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags WINPOS_GetMinMaxInfo( hwnd, &maxSize, &maxPos, &minTrack, &maxTrack); if (maxTrack.x < cx) cx = maxTrack.x; if (maxTrack.y < cy) cy = maxTrack.y; + if (minTrack.x > cx) cx = minTrack.x; + if (minTrack.y > cy) cy = minTrack.y; } if (cx < 0) cx = 0; -- 1.5.4.5