From d8ec0f3681fcbd985e2f7854df02c564f7bafa65 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 10 Jul 2008 14:05:54 -0700 Subject: [PATCH 2/2] user32: Clamp newly created windows to the minimum window size. --- dlls/user32/tests/msg.c | 26 +++++++++++++------------- dlls/user32/win.c | 2 ++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index c449107..423a18c 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -3391,7 +3391,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"); @@ -4583,49 +4583,49 @@ static void test_setwindowpos(void) const INT sysY = GetSystemMetrics(SM_CYMINTRACK); const struct wmsize_test wm[] = { { { 100, 50 }, { 100, 50 }, 0, 1, { sysX, 50 }, { sysX, 50 }, - { 1, 0, 1, 0, 1, 0, 0, 0, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 150, 5 }, { 150, 5 }, 0, 1, { 150, sysY }, { 150, sysY }, - { 0, 1, 0, 1, 1, 0, 0, 0, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 160, 150 }, { 160, 150 }, 0, 1, { 160, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 140, 150 }, { 160, 150 }, 0, 2, { 140, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 100, 50 }, { 100, 50 }, SWP_NOSIZE, 1, { sysX, 50 }, { sysX, 50 }, - { 1, 0, 1, 0, 0, 1, 0, 1, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 150, 5 }, { 150, 5 }, SWP_NOSIZE, 1, { 150, sysY }, { 150, sysY }, - { 0, 1, 0, 1, 0, 0, 1, 0, 1 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 160, 150 }, { 160, 150 }, SWP_NOSIZE, 1, { 160, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 140, 150 }, { 160, 150 }, SWP_NOSIZE, 1, { 140, 150 }, { 140, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 100, 50 }, { 100, 50 }, SWP_NOZORDER, 1, { sysX, 50 }, { sysX, 50 }, - { 1, 0, 1, 0, 1, 0, 0, 0, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 150, 5 }, { 150, 5 }, SWP_NOZORDER, 1, { 150, sysY }, { 150, sysY }, - { 0, 1, 0, 1, 1, 0, 0, 0, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 160, 150 }, { 160, 150 }, SWP_NOZORDER, 1, { 160, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 140, 150 }, { 160, 150 }, SWP_NOZORDER, 2, { 140, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 100, 50 }, { 100, 50 }, SWP_NOZORDER|SWP_NOSIZE, 1, { sysX, 50 }, { sysX, 50 }, - { 1, 0, 1, 0, 0, 1, 0, 1, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 150, 5 }, { 150, 5 }, SWP_NOZORDER|SWP_NOSIZE, 1, { 150, sysY }, { 150, sysY }, - { 0, 1, 0, 1, 0, 0, 1, 0, 1 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 160, 150 }, { 160, 150 }, SWP_NOZORDER|SWP_NOSIZE, 1, { 160, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 140, 150 }, { 160, 150 }, SWP_NOZORDER|SWP_NOSIZE, 1, { 140, 150 }, { 140, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 100, 50 }, { 100, 50 }, SWP_NOMOVE, 1, { sysX, 50 }, { sysX, 50 }, - { 1, 0, 1, 0, 1, 0, 0, 0, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 150, 5 }, { 150, 5 }, SWP_NOMOVE, 1, { 150, sysY }, { 150, sysY }, - { 0, 1, 0, 1, 1, 0, 0, 0, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 160, 150 }, { 160, 150 }, SWP_NOMOVE, 1, { 160, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 140, 150 }, { 160, 150 }, SWP_NOMOVE, 2, { 140, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 100, 50 }, { 100, 50 }, SWP_NOMOVE|SWP_NOSIZE, 1, { sysX, 50 }, { sysX, 50 }, - { 1, 0, 1, 0, 0, 1, 0, 1, 0 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 150, 5 }, { 150, 5 }, SWP_NOMOVE|SWP_NOSIZE, 1, { 150, sysY }, { 150, sysY }, - { 0, 1, 0, 1, 0, 0, 1, 0, 1 } }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 160, 150 }, { 160, 150 }, SWP_NOMOVE|SWP_NOSIZE, 1, { 160, 150 }, { 160, 150 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { 140, 150 }, { 160, 150 }, SWP_NOMOVE|SWP_NOSIZE, 1, { 140, 150 }, { 140, 150 }, 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