From: Esme Povirk esme@codeweavers.com
--- dlls/user32/tests/msg.c | 31 ++++++++++++++++--------------- dlls/win32u/window.c | 11 ++++++++++- 2 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 60067b7ab02..e0a4aa80618 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -622,7 +622,7 @@ static const struct message WmShowRestoreMinOverlappedSeq[] = { { WM_ERASEBKGND, sent|optional }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ - { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook|optional }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 }, { WM_SETFOCUS, sent|wparam|optional, 0 }, @@ -655,7 +655,7 @@ static const struct message WmShowMinOverlappedSeq[] = { { WM_NCCALCSIZE, sent|optional }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Not sent on win10. */ - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, { WM_NCACTIVATE, sent|wparam|optional, 0 }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ACTIVATE, sent|optional }, @@ -1537,7 +1537,7 @@ static const struct message WmShowChildInvisibleParentSeq_1[] = { { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|defwinproc|wparam|lparam, SIZE_MINIMIZED, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, { WM_GETTEXT, sent|optional }, { 0 } }; @@ -1575,7 +1575,7 @@ static const struct message WmShowChildInvisibleParentSeq_3[] = { { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|defwinproc|wparam|lparam, SIZE_MINIMIZED, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, { WM_GETTEXT, sent|optional }, { 0 } }; @@ -1594,7 +1594,7 @@ static const struct message WmShowChildInvisibleParentSeq_4[] = { { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|defwinproc|wparam|lparam, SIZE_MINIMIZED, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, /* FIXME: Wine creates an icon/title window while Windows doesn't */ { WM_GETTEXT, sent|optional }, { 0 } @@ -3987,7 +3987,7 @@ static const struct message WmRestoreMDIchildVisibleSeq_2[] = { { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|defwinproc|wparam, SIZE_RESTORED }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, /* MDI child */ - { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, /* MDI child */ + { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam, 0, 0 }, /* MDI child */ { HCBT_SETFOCUS, hook }, { WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, @@ -4005,7 +4005,7 @@ static const struct message WmMinimizeMDIchildVisibleSeq[] = { { WM_SIZE, sent|defwinproc|wparam|lparam, SIZE_MINIMIZED, 0 }, { WM_CHILDACTIVATE, sent|wparam|lparam|defwinproc, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, /* MDI child */ - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, /* MDI child */ + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, /* MDI child */ { 0 } }; /* ShowWindow(SW_RESTORE) for a not visible MDI child window */ @@ -15033,6 +15033,7 @@ static const struct message WmShowNoActivate_2[] = { { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|defwinproc, SIZE_RESTORED }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|wine_only, 0, 0 }, + { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|wine_only, 0, 0 }, { HCBT_SETFOCUS, hook|optional }, { HCBT_ACTIVATE, hook|optional }, /* win2003 doesn't send it */ { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|wine_only, 0, 0 }, @@ -15073,7 +15074,7 @@ static const struct message WmRestore_1[] = { { WM_SIZE, sent|wparam|defwinproc, SIZE_RESTORED }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ - { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook|optional }, /* win2000 sends it */ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 }, { 0 } @@ -15106,9 +15107,9 @@ static const struct message WmRestore_3[] = { { WM_SIZE, sent|wparam|defwinproc, SIZE_MAXIMIZED }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ + { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook|optional }, /* win2003 sends it */ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|wine_only, OBJID_CLIENT, 0 }, - { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, { 0 } }; static const struct message WmRestore_4[] = { @@ -15174,7 +15175,7 @@ static const struct message WmShowMinimized_1[] = { { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, { 0 } }; static const struct message WmMinimize_1[] = { @@ -15188,7 +15189,7 @@ static const struct message WmMinimize_1[] = { { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, { 0 } }; static const struct message WmMinimize_2[] = { @@ -15201,7 +15202,7 @@ static const struct message WmMinimize_2[] = { { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, { 0 } }; static const struct message WmMinimize_3[] = { @@ -15219,7 +15220,7 @@ static const struct message WmMinimize_3[] = { { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ - { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, { 0 } }; static const struct message WmShowMinNoActivate[] = { @@ -15277,7 +15278,7 @@ static const struct message WmShowMaximized_1[] = { { WM_SIZE, sent|wparam|defwinproc, SIZE_MAXIMIZED }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ - { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook|optional }, /* win2003 sends it */ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 }, { 0 } @@ -15300,7 +15301,7 @@ static const struct message WmShowMaximized_2[] = { { WM_SIZE, sent|wparam|defwinproc, SIZE_MAXIMIZED }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 seems to send this twice. */ - { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook|optional }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 }, { 0 } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index c0ebeb6e8a9..435fa0a1d5c 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -4265,7 +4265,7 @@ static BOOL show_window( HWND hwnd, INT cmd ) { WND *win; HWND parent; - LONG style = get_window_long( hwnd, GWL_STYLE ); + LONG style = get_window_long( hwnd, GWL_STYLE ), new_style; BOOL was_visible = (style & WS_VISIBLE) != 0; BOOL show_flag = TRUE; RECT newPos = {0, 0, 0, 0}; @@ -4368,6 +4368,15 @@ static BOOL show_window( HWND hwnd, INT cmd ) NtUserSetWindowPos( hwnd, HWND_TOP, newPos.left, newPos.top, newPos.right - newPos.left, newPos.bottom - newPos.top, swp );
+ new_style = get_window_long( hwnd, GWL_STYLE ); + if (((style ^ new_style) & WS_MINIMIZE) != 0) + { + if ((new_style & WS_MINIMIZE) != 0) + NtUserNotifyWinEvent( EVENT_SYSTEM_MINIMIZESTART, hwnd, OBJID_WINDOW, 0 ); + else + NtUserNotifyWinEvent( EVENT_SYSTEM_MINIMIZEEND, hwnd, OBJID_WINDOW, 0 ); + } + if (cmd == SW_HIDE) { HWND hFocus;