Dmitry Timoshkov : user32: If there is no dialog controls to set focus to then set focus to dialog itself.
Alexandre Julliard
julliard at winehq.org
Sun Mar 3 13:21:31 CST 2019
Module: wine
Branch: oldstable
Commit: 3650a23dbcbcc69488bf438a604cc1e882bbedf3
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3650a23dbcbcc69488bf438a604cc1e882bbedf3
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Wed Nov 28 09:03:15 2018 +0300
user32: If there is no dialog controls to set focus to then set focus to dialog itself.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 44f89322ba8825a8e4851aaaf7de89910701ca75)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/user32/dialog.c | 2 ++
dlls/user32/tests/msg.c | 9 +++++----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index eeb5146..ff1cc95 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -691,6 +691,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
SendMessageW( focus, EM_SETSEL, 0, MAXLONG );
SetFocus( focus );
}
+ else
+ SetFocus( hwnd );
}
}
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index baa232f..eb5d4c4 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -12998,10 +12998,12 @@ static const struct message WmCreateDialogParamSeq_1[] = {
{ WM_MOVE, sent },
{ WM_SETFONT, sent },
{ WM_INITDIALOG, sent },
- { WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
+ { WM_GETDLGCODE, sent|wparam|lparam|optional, 0, 0 }, /* FIXME: Wine doesn't send it */
{ HCBT_SETFOCUS, hook },
{ HCBT_ACTIVATE, hook },
- { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE },
+ { WM_QUERYNEWPALETTE, sent|optional },
+ { WM_PALETTEISCHANGING, sent|optional },
+ { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
{ WM_ACTIVATEAPP, sent|wparam, 1 },
{ WM_NCACTIVATE, sent },
{ WM_ACTIVATE, sent|wparam, 1 },
@@ -13184,9 +13186,8 @@ static void test_dialog_messages(void)
flush_sequence();
hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 1);
ok(IsWindow(hdlg), "CreateDialogParam failed\n");
- ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", TRUE);
+ ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", FALSE);
hfocus = GetFocus();
-todo_wine
ok(hfocus == hdlg, "wrong focus %p\n", hfocus);
EndDialog(hdlg, 0);
DestroyWindow(hdlg);
More information about the wine-cvs
mailing list