From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/msg.c | 2 -- dlls/win32u/window.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 9282896262e..2b0baae7cf3 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -15378,9 +15378,7 @@ static const struct message WmShowMinimized_1[] = { { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|wine_only, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ - { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|wine_only, OBJID_CLIENT, 0 }, { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 1cea6d25a4b..98e2e46e67d 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -3826,10 +3826,11 @@ BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y )
if (!(winpos->flags & (SWP_NOACTIVATE|SWP_HIDEWINDOW))) { + UINT style = get_window_long( winpos->hwnd, GWL_STYLE ); /* child windows get WM_CHILDACTIVATE message */ - if ((get_window_long( winpos->hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD) + if ((style & (WS_CHILD | WS_POPUP)) == WS_CHILD) send_message( winpos->hwnd, WM_CHILDACTIVATE, 0, 0 ); - else + else if (!(style & WS_MINIMIZE)) set_foreground_window( winpos->hwnd, FALSE ); }