From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/user32/tests/msg.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 9282896262e..274bb5143df 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -1922,6 +1922,38 @@ static const struct message WmModalDialogSeq_2[] = { { WM_NCDESTROY, sent }, { 0 } }; +static const struct message create_visible_dialog_seq[] = +{ + { HCBT_CREATEWND, hook }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 }, + { WM_SETFONT, sent }, + { WM_INITDIALOG, sent }, + { WM_CHANGEUISTATE, sent|optional }, + { WM_SHOWWINDOW, sent|wparam, 1 }, + { HCBT_ACTIVATE, hook }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE }, + { WM_ACTIVATEAPP, sent|wparam, 1 }, + { WM_NCACTIVATE, sent|wparam, 0 }, + { WM_ACTIVATE, sent|wparam, 1 }, + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { WM_SETFOCUS, sent }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE }, + { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 }, + { WM_NCPAINT, sent|wparam, 1 }, + { WM_ERASEBKGND, sent }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, + /* the following 6 messages only appear before windows 8 */ + { WM_NCCALCSIZE, sent|wparam|optional, 0 }, + { WM_NCPAINT, sent|wparam|optional, 1 }, + { WM_ERASEBKGND, sent|optional }, + { WM_MOVE, sent|optional }, + { WM_SIZE, sent|wparam|optional, SIZE_RESTORED }, + { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, + { WM_PAINT, sent }, + { WM_CTLCOLORBTN, sent }, + { 0 } +}; /* SetMenu for NonVisible windows with size change*/ static const struct message WmSetMenuNonVisibleSizeChangeSeq[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE }, @@ -16195,6 +16227,13 @@ static void test_dialog_messages(void) DestroyWindow(child); DestroyWindow(parent); flush_sequence(); + + hdlg = CreateDialogParamA(0, "TEST_DIALOG", 0, test_dlg_proc, 0); + ok(IsWindow(hdlg), "CreateDialogParam failed\n"); + ok_sequence(create_visible_dialog_seq, "create visible dialog", TRUE); + EndDialog(hdlg, 0); + DestroyWindow(hdlg); + flush_sequence(); }
static void test_enddialog_seq(HWND dialog, HWND owner)
From: Sebastian Lackner sebastian@fds-team.de
This partially reverts 52146f62fd28bc1a791734b9939378267140b095.
As stated in that commit, a WM_PAINT will eventually be generated via window exposure. However, some applications rely on WM_PAINT being sent synchronously. As create_visible_dialog_seq shows, this happens reliably, and the behaviour is specific to dialogs.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35652 --- dlls/user32/dialog.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index 661a5cda752..10d58ed0c73 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -704,6 +704,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) { NtUserShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */ + UpdateWindow( hwnd ); } return hwnd; }
This merge request was approved by Elizabeth Figura.
Sven Baars (@sbaars) commented about dlls/user32/dialog.c:
if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) { NtUserShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
The indentation looks a bit awkward now.