I expect this is going to be tricky to get in. I ran into the following issues: * test_ShowWindow behaves very strangely on Windows. It seems this isn't typical behavior, and is caused by an interaction with test_SetFocus, but I'm not sure exactly what it does to the thread state that causes this. * Many of the SetWindowPos flag combinations tested don't actually show the window on Windows, therefore they don't send EVENT_SYSTEM_FOREGROUND. I was able to reproduce this with a stand-alone test, so it seems to be normal behavior. * Windows can show a window without activating it, and Wine on X11 can't do that reliably for managed windows. * There are a couple of cases where Windows sends an event and Wine doesn't. I figure it's OK to not cover every case, but I can go back and investigate those if needed.
This interacts with https://gitlab.winehq.org/wine/wine/-/merge_requests/2314, in that the tests don't really test much without it. I applied that MR for my own testing.
From: Esme Povirk esme@codeweavers.com
If test_SetFocus is executed before this one, Windows behaves very strangely and does not activate the window when shown. The EVENT_OBJECT_FOREGROUND messages also don't match up with when the window becomes the foreground. I haven't been able to recreate this behavior in a stand-alone test program, so I don't know what causes it, but I'm sure it's not the typical behavior on Windows. --- dlls/user32/tests/msg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 6faaa2c2f40..f02b976ae83 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -14303,8 +14303,10 @@ static const struct message WmShow[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { HCBT_SETFOCUS, hook|optional }, /* win2000 doesn't send it */ + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 }, { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, { 0 } }; @@ -14363,8 +14365,10 @@ static const struct message WmRestore_1[] = { { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { HCBT_SETFOCUS, hook|optional }, /* win2000 doesn't send it */ + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 }, { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|defwinproc, SIZE_RESTORED }, @@ -14460,6 +14464,7 @@ static const struct message WmShowMinimized_1[] = { { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_MOVE, sent|defwinproc }, @@ -14560,8 +14565,10 @@ static const struct message WmShowMaximized_1[] = { { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { HCBT_SETFOCUS, hook|optional }, /* win2000 doesn't send it */ + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 }, { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|defwinproc, SIZE_MAXIMIZED }, @@ -19664,6 +19671,7 @@ START_TEST(msg) hCBT_hook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, 0, GetCurrentThreadId()); if (!hCBT_hook) win_skip( "cannot set global hook, will skip hook tests\n" );
+ test_ShowWindow(); test_winevents(); test_SendMessage_other_thread(1); test_SendMessage_other_thread(2); @@ -19672,7 +19680,6 @@ START_TEST(msg) test_SetParent(); test_PostMessage(); test_broadcast(); - test_ShowWindow(); test_PeekMessage(); test_PeekMessage2(); test_PeekMessage3();
From: Esme Povirk esme@codeweavers.com
This verifies that the "optional" messages are the result of Wine showing the window when it shouldn't, and it makes it possible to document the todo. --- dlls/user32/tests/msg.c | 73 ++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 33 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index f02b976ae83..b857651d366 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -5488,9 +5488,9 @@ static DWORD CALLBACK show_window_thread( LPVOID arg ) }
/* Helper function to easier test SetWindowPos messages */ -#define test_msg_setpos( expected_list, flags, todo ) \ - test_msg_setpos_( (expected_list), (flags), (todo), __FILE__, __LINE__) -static void test_msg_setpos_(const struct message *expected_list, UINT flags, BOOL todo, const char *file, int line) +#define test_msg_setpos( expected_list, flags, todo, shown ) \ + test_msg_setpos_( (expected_list), (flags), (todo), (shown), __FILE__, __LINE__) +static void test_msg_setpos_(const struct message *expected_list, UINT flags, BOOL todo, BOOL shown, const char *file, int line) { HWND hwnd;
@@ -5501,6 +5501,13 @@ static void test_msg_setpos_(const struct message *expected_list, UINT flags, BO ok (hwnd != 0, "Failed to create popup window\n"); SetWindowPos(hwnd, NULL, 0, 0, 100, 100, flags); ok_sequence_(expected_list, "SetWindowPos:show_popup_first_show_window", todo, file, line); + + if (shown) + ok_(file, line)(GetWindowLongPtrA(hwnd, GWL_STYLE) & WS_VISIBLE, "window should be shown\n"); + else + todo_wine_if(flags & (SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE)) + ok_(file, line)(!(GetWindowLongPtrA(hwnd, GWL_STYLE) & WS_VISIBLE), "window should not be shown\n"); + DestroyWindow(hwnd); }
@@ -5673,37 +5680,37 @@ static void test_messages(void) DestroyWindow(hwnd);
/* Test SetWindowPos */ - test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq2, 0, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq2, 0, FALSE, FALSE); test_msg_setpos(WmFirstDrawSetWindowPosSeq3, - SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOZORDER, FALSE); - - test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOSIZE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq4, SWP_SHOWWINDOW | SWP_NOMOVE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCLIENTSIZE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCLIENTMOVE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOZORDER, FALSE); - - test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOCLIENTMOVE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOCLIENTSIZE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq5, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOMOVE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOSIZE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOZORDER, FALSE); - - test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOCLIENTMOVE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOCLIENTSIZE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq4, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOMOVE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSIZE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOZORDER, FALSE); - - test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_NOREDRAW, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOCLIENTMOVE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOCLIENTSIZE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq5, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOSIZE, FALSE); - test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOZORDER, FALSE); + SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOZORDER, FALSE, FALSE); + + test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOSIZE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq4, SWP_SHOWWINDOW | SWP_NOMOVE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCLIENTSIZE, FALSE, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCLIENTMOVE, FALSE, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOZORDER, FALSE, TRUE); + + test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOCLIENTMOVE, FALSE, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOCLIENTSIZE, FALSE, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq5, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOMOVE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOSIZE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOZORDER, FALSE, TRUE); + + test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOCLIENTMOVE, FALSE, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOCLIENTSIZE, FALSE, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq4, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOMOVE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSIZE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOZORDER, FALSE, TRUE); + + test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_NOREDRAW, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOCLIENTMOVE, FALSE, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOCLIENTSIZE, FALSE, FALSE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq5, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOSIZE, FALSE, TRUE); + test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOZORDER, FALSE, TRUE);
/* Test SetWindowPos with child windows */ flush_events();
From: Esme Povirk esme@codeweavers.com
--- dlls/user32/tests/msg.c | 77 +++++++++++++++++++++-------------------- dlls/win32u/input.c | 2 ++ 2 files changed, 42 insertions(+), 37 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index b857651d366..6e546bbb5b1 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -199,7 +199,7 @@ static const struct message WmSWP_ShowOverlappedSeq[] = { { WM_GETTEXT, sent|defwinproc|optional }, { WM_ERASEBKGND, sent|optional }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_NOTIFYFORMAT, sent|optional }, { WM_QUERYUISTATE, sent|optional }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, @@ -750,7 +750,7 @@ static const struct message WmCreateMaxPopupSeq[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_NCPAINT, sent|wparam|optional, 1 }, @@ -800,7 +800,7 @@ static const struct message WmShowMaxPopupResizedSeq[] = { { WM_NCCALCSIZE, sent|wparam, TRUE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_NCPAINT, sent|wparam|optional, 1 }, @@ -832,7 +832,7 @@ static const struct message WmShowMaxPopupSeq[] = { { WM_NCCALCSIZE, sent|wparam, TRUE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_NCPAINT, sent|wparam|optional, 1 }, @@ -870,7 +870,7 @@ static const struct message WmCreatePopupSeq[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_NCPAINT, sent|wparam|optional, 1 }, @@ -919,7 +919,7 @@ static const struct message WmShowRestoreMinimizedOverlappedSeq[] = { WM_NCCALCSIZE, sent }, { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_NCACTIVATE, sent }, { WM_GETTEXT, sent|defwinproc|optional }, @@ -1109,7 +1109,7 @@ static const struct message WmShowVisiblePopupSeq_2[] = { static const struct message WmShowVisiblePopupSeq_3[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_NCACTIVATE, sent }, @@ -1139,7 +1139,7 @@ static const struct message WmShowPopupExtremeLocationSeq[] = { { WM_WINDOWPOSCHANGING, sent }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_QUERYNEWPALETTE, sent|optional },
@@ -1180,7 +1180,7 @@ static const struct message WmShowPopupFirstDrawSeq_1[] = { { WM_WINDOWPOSCHANGING, sent }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_QUERYNEWPALETTE, sent|optional }, { WM_ACTIVATEAPP, sent }, @@ -1218,7 +1218,7 @@ static const struct message WmShowPopupFirstDrawSeq_2[] = { { WM_NCCALCSIZE, sent|wparam, TRUE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_NCPAINT, sent|optional|wparam, 1 }, { WM_ERASEBKGND, sent|optional }, @@ -1257,7 +1257,7 @@ static const struct message WmFirstDrawSetWindowPosSeq1[] = { { WM_WINDOWPOSCHANGING, sent }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_QUERYNEWPALETTE, sent|optional }, { WM_ACTIVATEAPP, sent }, @@ -1288,7 +1288,7 @@ static const struct message WmFirstDrawSetWindowPosSeq2[] = { { WM_WINDOWPOSCHANGING, sent }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Not always sent. */ { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|optional }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_ACTIVATEAPP, sent }, @@ -1316,6 +1316,7 @@ static const struct message WmFirstDrawSetWindowPosSeq3[] = { { WM_MOVE, sent }, { HCBT_ACTIVATE, hook|optional }, /* Probably shouldn't happen, but not part of this test */ + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 }, { WM_QUERYNEWPALETTE, sent|optional }, { WM_ACTIVATEAPP, sent|optional }, { WM_NCACTIVATE, sent|optional }, @@ -1335,7 +1336,7 @@ static const struct message WmFirstDrawSetWindowPosSeq4[] = { { WM_WINDOWPOSCHANGING, sent }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_QUERYNEWPALETTE, sent|optional }, { WM_ACTIVATEAPP, sent }, @@ -1364,7 +1365,7 @@ static const struct message WmFirstDrawSetWindowPosSeq5[] = { { WM_WINDOWPOSCHANGING, sent }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_QUERYNEWPALETTE, sent|optional }, { WM_ACTIVATEAPP, sent }, @@ -1681,7 +1682,7 @@ static const struct message WmCreateCustomDialogSeq[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 },
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, @@ -1732,7 +1733,7 @@ static const struct message WmEndCustomDialogSeq[] = { { WM_GETTEXT, sent|optional|defwinproc }, { WM_GETTEXT, sent|optional|defwinproc }, { WM_ACTIVATE, sent|wparam, 0 }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOACTIVATE|SWP_NOREDRAW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, { WM_GETTEXT, sent|optional|defwinproc }, @@ -1752,7 +1753,7 @@ static const struct message WmShowCustomDialogSeq[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 },
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
@@ -1793,7 +1794,7 @@ static const struct message WmModalDialogSeq[] = { { WM_UPDATEUISTATE, sent|optional }, { WM_SHOWWINDOW, sent }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { 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_NCACTIVATE, sent }, @@ -1847,7 +1848,7 @@ static const struct message WmModalDialogSeq[] = { { WM_NCACTIVATE, sent|wparam, 0 }, { WM_GETTEXT, sent|optional }, { WM_ACTIVATE, sent|wparam, 0 }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_WINDOWPOSCHANGED, sent|optional }, { HCBT_SETFOCUS, hook }, @@ -2948,7 +2949,7 @@ static const struct message WmCreateMDIframeSeq[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* XP */ { WM_ACTIVATEAPP, sent|wparam|optional, 1 }, /* Win9x doesn't send it */ @@ -5324,7 +5325,7 @@ static const struct message WmZOrder[] = { { WM_WINDOWPOSCHANGING, sent|wparam, 0, 0 }, { WM_GETMINMAXINFO, sent|defwinproc|wparam, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam, 3, 0 }, { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOREDRAW|SWP_NOMOVE|SWP_NOSIZE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE, 0 }, @@ -14297,7 +14298,7 @@ static const struct message WmShowNormal[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2003 doesn't send it */ { HCBT_SETFOCUS, hook }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 }, @@ -14310,7 +14311,7 @@ static const struct message WmShow[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { HCBT_SETFOCUS, hook|optional }, /* win2000 doesn't send it */ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 }, @@ -14345,6 +14346,7 @@ static const struct message WmShowNoActivate_2[] = { { WM_SIZE, sent|wparam|defwinproc, SIZE_RESTORED }, { HCBT_SETFOCUS, hook|optional }, { HCBT_ACTIVATE, hook|optional }, /* win2003 doesn't send it */ + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 }, /* windows does not activate when showing */ { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2003 doesn't send it */ { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, { HCBT_SETFOCUS, hook|optional }, /* win2003 doesn't send it */ @@ -14372,7 +14374,7 @@ static const struct message WmRestore_1[] = { { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { HCBT_SETFOCUS, hook|optional }, /* win2000 doesn't send it */ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 }, @@ -14391,6 +14393,7 @@ static const struct message WmRestore_2[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 }, /* windows does not activate when showing */ { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { HCBT_SETFOCUS, hook|optional }, /* win2000 doesn't send it */ { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, @@ -14471,7 +14474,7 @@ static const struct message WmShowMinimized_1[] = { { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_MOVE, sent|defwinproc }, @@ -14572,7 +14575,7 @@ static const struct message WmShowMaximized_1[] = { { EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */ - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* win2000 doesn't send it */ { HCBT_SETFOCUS, hook|optional }, /* win2000 doesn't send it */ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 }, @@ -15017,7 +15020,7 @@ static const struct message WmCreateDialogParamSeq_1[] = { { WM_GETDLGCODE, sent|wparam|lparam|optional, 0, 0 }, /* FIXME: Wine doesn't send it */ { HCBT_SETFOCUS, hook }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|optional }, { WM_PALETTEISCHANGING, sent|optional }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, @@ -15054,7 +15057,7 @@ static const struct message WmCreateDialogParamSeq_3[] = { { EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX }, { EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|parent|optional }, /* TODO: this message should not be sent */ { WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, @@ -15091,7 +15094,7 @@ static const struct message WmCreateDialogParamSeq_4[] = { { EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX }, { EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|parent|optional }, /* TODO: this message should not be sent */ { WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, @@ -15292,7 +15295,7 @@ static void test_enddialog_seq(HWND dialog, HWND owner) { HCBT_ACTIVATE, hook|wparam, (WPARAM)owner }, { WM_NCACTIVATE, sent|wparam|lparam, WA_INACTIVE, (LPARAM)owner }, { WM_ACTIVATE, sent|wparam|lparam, WA_INACTIVE, (LPARAM)owner }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, /* FIXME: Following two are optional because Wine sends WM_QUERYNEWPALETTE instead of WM_WINDOWPOSCHANGING */ { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_QUERYNEWPALETTE, sent|optional }, @@ -15320,7 +15323,7 @@ static void test_enddialog_seq2(HWND dialog, HWND owner) { HCBT_ACTIVATE, hook|wparam, (WPARAM)owner }, { WM_NCACTIVATE, sent|wparam|lparam, WA_INACTIVE, (LPARAM)owner }, { WM_ACTIVATE, sent|wparam|lparam, WA_INACTIVE, (LPARAM)owner }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|optional|wparam, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGING, sent|optional|wparam, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE }, { HCBT_SETFOCUS, hook|wparam, (WPARAM)owner }, @@ -15505,7 +15508,7 @@ static const struct message SetActiveWindowSeq2[] = { WM_NCACTIVATE, sent|wparam, 0 }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ACTIVATE, sent|wparam, 0 }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE }, @@ -15532,7 +15535,7 @@ static const struct message SetActiveWindowSeq2[] = static const struct message SetActiveWindowSeq3[] = { { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { 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|SWP_NOACTIVATE }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE }, @@ -15556,7 +15559,7 @@ static const struct message SetActiveWindowSeq4[] = { WM_NCACTIVATE, sent|wparam, 0 }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ACTIVATE, sent|wparam, 0 }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { 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_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE }, @@ -16897,7 +16900,7 @@ static const struct message WmRestoreMinimizedOverlappedSeq[] = { WM_ERASEBKGND, sent|optional }, { WM_WINDOWPOSCHANGED, sent|optional }, { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE }, { WM_ACTIVATEAPP, sent|wparam, TRUE }, { WM_NCACTIVATE, sent|wparam, TRUE }, @@ -18578,7 +18581,7 @@ end: static const struct message WmSetFocus_1[] = { { HCBT_SETFOCUS, hook }, /* child */ { HCBT_ACTIVATE, hook }, /* parent */ - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|parent|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|parent, 0, SWP_NOSIZE|SWP_NOMOVE }, { WM_ACTIVATEAPP, sent|wparam|parent, 1 }, @@ -19415,7 +19418,7 @@ static void test_DoubleSetCapture(void) static const struct message WmRestoreMinimizedSeq[] = { { HCBT_ACTIVATE, hook }, - { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, { WM_ACTIVATEAPP, sent|wparam, 1 }, diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index fb9824759b2..60fd58cc95e 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1872,6 +1872,8 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
if (hwnd) { + NtUserNotifyWinEvent( EVENT_SYSTEM_FOREGROUND, hwnd, 0, 0 ); + /* send palette messages */ if (send_message( hwnd, WM_QUERYNEWPALETTE, 0, 0 )) send_message_timeout( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0,
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=132815
Your paranoid android.
=== w7u_adm (32 bit report) ===
user32: msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 1: in msg 0x0046 expecting wParam 0x8070 got 0x8060 msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 3: the msg 0x0047 was expected, but got msg 0x0005 instead
=== w7u_el (32 bit report) ===
user32: msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 1: in msg 0x0046 expecting wParam 0x8070 got 0x8060 msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 3: the msg 0x0047 was expected, but got msg 0x0005 instead
=== w8 (32 bit report) ===
user32: msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 1: in msg 0x0046 expecting wParam 0x8070 got 0x8060 msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 3: the msg 0x0047 was expected, but got msg 0x0005 instead
=== w864 (32 bit report) ===
user32: msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 1: in msg 0x0046 expecting wParam 0x8070 got 0x8060 msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 3: the msg 0x0047 was expected, but got msg 0x0005 instead
=== w1064v1507 (32 bit report) ===
user32: msg.c:14832: Test failed: 5: ShowWindow(SW_SHOWMINIMIZED): 7: in msg 0x0047 expecting wParam 0x8160 got 0x1803 msg.c:14832: Test failed: 5: ShowWindow(SW_SHOWMINIMIZED): 8: the msg 0x0003 was expected, but got msg 0x0047 instead msg.c:14832: Test failed: 5: ShowWindow(SW_SHOWMINIMIZED): 9: the msg 0x0005 was expected, but got msg 0x0003 instead msg.c:14832: Test failed: 5: ShowWindow(SW_SHOWMINIMIZED): 10: the msg 0x800b was expected, but got msg 0x0005 instead
=== w7pro64 (64 bit report) ===
user32: msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 1: in msg 0x0046 expecting wParam 0x8070 got 0x8060 msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 3: the msg 0x0047 was expected, but got msg 0x0005 instead
=== w1064_2qxl (64 bit report) ===
user32: msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 1: in msg 0x0046 expecting wParam 0x8070 got 0x8060 msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 3: the msg 0x0047 was expected, but got msg 0x0005 instead
=== w1064_tsign (64 bit report) ===
user32: msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 1: in msg 0x0046 expecting wParam 0x8070 got 0x8060 msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 3: the msg 0x0047 was expected, but got msg 0x0005 instead
=== w10pro64_zh_CN (64 bit report) ===
user32: msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 1: in msg 0x0046 expecting wParam 0x8070 got 0x8060 msg.c:14832: Test failed: 13: ShowWindow(SW_SHOWNOACTIVATE): 3: the msg 0x0047 was expected, but got msg 0x0005 instead
=== debian11 (32 bit report) ===
winhttp: notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:118: Test failed: 994: expected status 0x20000 got 0x1 notification.c:123: Test failed: 994: expected callback 0x1 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x2 notification.c:123: Test failed: 994: expected callback 0x2 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4 notification.c:123: Test failed: 994: expected callback 0x4 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x8 notification.c:123: Test failed: 994: expected callback 0x8 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x4000 notification.c:123: Test failed: 994: expected callback 0x4000 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x10 notification.c:123: Test failed: 994: expected callback 0x10 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x20 notification.c:123: Test failed: 994: expected callback 0x20 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x40 notification.c:123: Test failed: 994: expected callback 0x40 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x80 notification.c:123: Test failed: 994: expected callback 0x80 to be called from the same thread notification.c:118: Test failed: 994: expected status 0x20000 got 0x200000 notification.c:123: Test failed: 994: expected callback 0x200000 to be called from the same thread notification: Timeout winhttp.c:3543: Test failed: got 8 winhttp.c:3549: Test failed: got 12019 winhttp.c:3550: Test failed: got 3735928559 Unhandled exception: page fault on write access to 0x00000008 in 32-bit code (0x63c04786).
=== debian11b (64 bit WoW report) ===
Report validation errors: win32u:win32u returned success despite having failures
Rémi Bernon (@rbernon) commented about dlls/user32/tests/msg.c:
hCBT_hook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, 0, GetCurrentThreadId()); if (!hCBT_hook) win_skip( "cannot set global hook, will skip hook tests\n" );
- test_ShowWindow();
The `test_SetFocus` problem comes from it giving focus to an invisible window. It looks like this cause the foreground attribute to be offered to another process when the windows are destroyed, and the test process loses it for good even if it later creates additional windows.
I think a better workaround would be to move test_SetFocus below all the other tests, although an even better solution would perhaps to have an always present fallback window and avoid losing foreground state entirely (because I think this is also happening in other tests, sometimes spuriously).
On Fri May 26 12:58:49 2023 +0000, Rémi Bernon wrote:
The `test_SetFocus` problem comes from it giving focus to an invisible window. It looks like this cause the foreground attribute to be offered to another process when the windows are destroyed, and the test process loses it for good even if it later creates additional windows. I think a better workaround would be to move test_SetFocus below all the other tests, although an even better solution would perhaps to have an always present fallback window and avoid losing foreground state entirely (because I think this is also happening in other tests, sometimes spuriously).
I like the fallback window idea, I'll try that, thanks.
On Fri May 26 13:19:20 2023 +0000, Esme Povirk wrote:
I like the fallback window idea, I'll try that, thanks.
I'm not sure this approach is going to be acceptable. Having a window in the same thread that receives the focus when the tested window loses focus changes things a lot.
On Sat May 27 20:42:00 2023 +0000, Esme Povirk wrote:
I'm not sure this approach is going to be acceptable. Having a window in the same thread that receives the focus when the tested window loses focus changes things a lot.
You should probably move it to the bottom and add a comment about why it breaks the other tests then.
Rémi Bernon (@rbernon) commented about dlls/user32/tests/msg.c:
{ WM_MOVE, sent }, { HCBT_ACTIVATE, hook|optional }, /* Probably shouldn't happen, but not part of this test */
- { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 },
Fwiw it's a bit confusing that this is added here, where the event is implemented, and not before.
Rémi Bernon (@rbernon) commented about dlls/user32/tests/msg.c:
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 }, { HCBT_ACTIVATE, hook|optional }, /* win2000 doesn't send it */
- { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 }, /* windows does not activate when showing */
Same here.
Rémi Bernon (@rbernon) commented about dlls/user32/tests/msg.c:
{ WM_SIZE, sent|wparam|defwinproc, SIZE_RESTORED }, { HCBT_SETFOCUS, hook|optional }, { HCBT_ACTIVATE, hook|optional }, /* win2003 doesn't send it */
- { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 }, /* windows does not activate when showing */
Same here.
This merge request was closed by Esme Povirk.