diff --git a/dlls/user/tests/msg.c b/dlls/user/tests/msg.c index 00e1679d9fa..a5ddac349e4 100644 --- a/dlls/user/tests/msg.c +++ b/dlls/user/tests/msg.c @@ -228,6 +228,44 @@ static const struct message WmShowOverlappedSeq[] = { #endif { 0 } }; +/* ShowWindow(SW_SHOWMAXIMIZED) for a not visible overlapped window */ +static const struct message WmShowMaxOverlappedSeq[] = { + { HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE }, + { WM_GETMINMAXINFO, sent }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|0x8000 }, + { WM_GETMINMAXINFO, sent|defwinproc }, + { WM_NCCALCSIZE, sent|wparam, TRUE }, + { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 }, + { HCBT_ACTIVATE, hook }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, + { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE }, + { WM_ACTIVATEAPP, sent|wparam, 1 }, + { WM_NCACTIVATE, sent|wparam, 1 }, + { WM_GETICON, sent|optional }, + { WM_GETICON, sent|optional }, + { WM_GETICON, sent|optional }, + { WM_GETTEXT, sent|defwinproc|optional }, + { WM_ACTIVATE, sent|wparam, 1 }, + { HCBT_SETFOCUS, hook }, + { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, + { WM_IME_NOTIFY, sent|defwinproc|optional }, + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_NCPAINT, sent|wparam|optional, 1 }, + { WM_GETTEXT, sent|defwinproc|optional }, + { WM_ERASEBKGND, sent|optional }, + /* Win9x adds SWP_NOZORDER below */ + { WM_WINDOWPOSCHANGED, sent, /*|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE*/ }, + { WM_MOVE, sent|defwinproc }, + { WM_SIZE, sent|defwinproc }, + { WM_NCCALCSIZE, sent|optional }, + { WM_NCPAINT, sent|optional }, + { WM_ERASEBKGND, sent|optional }, + { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, + { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, + { 0 } +}; /* ShowWindow(SW_HIDE) for a visible overlapped window */ static const struct message WmHideOverlappedSeq[] = { { WM_SHOWWINDOW, sent|wparam, 0 }, @@ -2932,6 +2970,16 @@ static void test_messages(void) ShowWindow(hwnd, SW_SHOW); ok_sequence(WmShowOverlappedSeq, "ShowWindow(SW_SHOW):overlapped", TRUE); + ShowWindow(hwnd, SW_HIDE); + ok_sequence(WmHideOverlappedSeq, "ShowWindow(SW_HIDE):overlapped", TRUE); + + ShowWindow(hwnd, SW_SHOWMAXIMIZED); + ok_sequence(WmShowMaxOverlappedSeq, "ShowWindow(SW_SHOWMAXIMIZED):overlapped", TRUE); + + ShowWindow(hwnd, SW_RESTORE); + /* FIXME: add ok_sequence() here */ + flush_sequence(); + ShowWindow(hwnd, SW_SHOW); ok_sequence(WmEmptySeq, "ShowWindow(SW_SHOW):overlapped already visible", FALSE); diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c index dddc554f498..91325480b08 100644 --- a/dlls/x11drv/winpos.c +++ b/dlls/x11drv/winpos.c @@ -989,7 +989,7 @@ BOOL X11DRV_ShowWindow( HWND hwnd, INT cmd ) break; } - if (showFlag != wasVisible || cmd == SW_SHOWNA) + if ((showFlag != wasVisible || cmd == SW_SHOWNA) && cmd != SW_SHOWMAXIMIZED) { SendMessageW( hwnd, WM_SHOWWINDOW, showFlag, 0 ); if (!IsWindow( hwnd )) return wasVisible;