Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51576 Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/msi/dialog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 703f9d43957..6463c3062ac 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -3904,7 +3904,7 @@ static void process_pending_messages( HWND hdlg ) static UINT dialog_run_message_loop( msi_dialog *dialog ) { DWORD style; - HWND hwnd; + HWND hwnd, parent;
if( uiThreadId != GetCurrentThreadId() ) return SendMessageW( hMsiHiddenWindow, WM_MSI_DIALOG_CREATE, 0, (LPARAM) dialog ); @@ -3917,9 +3917,11 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize)) style |= WS_MINIMIZEBOX;
+ parent = dialog->parent ? dialog->parent->hwnd : 0; + hwnd = CreateWindowW( L"MsiDialogCloseClass", dialog->name, style, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - NULL, NULL, NULL, dialog ); + parent, NULL, NULL, dialog ); if( !hwnd ) { ERR("Failed to create dialog %s\n", debugstr_w( dialog->name )); -- 2.33.0
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51717 Signed-off-by: Fabian Maurer dark.shadow4@web.de --- v3: Add missing call to SetForegroundWindow --- dlls/msi/dialog.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 6463c3062ac..a99a9076946 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -3881,6 +3881,11 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, return SendMessageW( (HWND) lParam, WM_CTLCOLORSTATIC, wParam, lParam );
case WM_DESTROY: + if (dialog->parent) + { + EnableWindow(dialog->parent->hwnd, TRUE); + SetForegroundWindow(dialog->parent->hwnd); + } dialog->hwnd = NULL; return 0; case WM_NOTIFY: @@ -3928,6 +3933,11 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) return ERROR_FUNCTION_FAILED; }
+ if (parent) + { + EnableWindow(parent, FALSE); + } + ShowWindow( hwnd, SW_SHOW ); /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */
-- 2.33.0
On Sun, 2021-09-12 at 01:56 +0200, Fabian Maurer wrote:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51717 Signed-off-by: Fabian Maurer dark.shadow4@web.de
v3: Add missing call to SetForegroundWindow
dlls/msi/dialog.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 6463c3062ac..a99a9076946 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -3881,6 +3881,11 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, return SendMessageW( (HWND) lParam, WM_CTLCOLORSTATIC, wParam, lParam );
case WM_DESTROY:
if (dialog->parent)
{
EnableWindow(dialog->parent->hwnd, TRUE);
SetForegroundWindow(dialog->parent->hwnd);
}
dialog->hwnd = NULL; return 0; case WM_NOTIFY: @@ -3928,6 +3933,11 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) return ERROR_FUNCTION_FAILED; }
- if (parent)
- {
EnableWindow(parent, FALSE);
- }
Should this be done only for dialogs with the msidbDialogAttributesModal attribute set, as suggested by the patch description?
Should this be done only for dialogs with the msidbDialogAttributesModal attribute set, as suggested by the patch description?
Can there be dialogs with a parent that are non modal? Because AFAIK that isn't possible - at least I could not create that case
Regards, Fabian Maurer
On Mon, 2021-09-13 at 13:29 +0200, Fabian Maurer wrote:
Should this be done only for dialogs with the msidbDialogAttributesModal attribute set, as suggested by the patch description?
Can there be dialogs with a parent that are non modal? Because AFAIK that isn't possible - at least I could not create that case
Could you add a test case?
Could you add a test case?
Sorry, I don't know how. There don't seem to be existing dialog testcases...
Regards, Fabian Maurer
So,
how does one test msi dialogs directly? Aren't they used in the msi internally?
Regards, Fabian Maurer
On Wed, 2021-09-15 at 12:45 +0200, Fabian Maurer wrote:
how does one test msi dialogs directly? Aren't they used in the msi internally?
You would need to create an installer with appropriate tables, such as Dialog, Control and ControlEvent. It may need user interaction so it would need to be interactive.
A standalone test would work too. The point is that I'm not convinced that we don't need to check the msidbDialogAttributesModal attribute.
This last patch is a bit different. It fixes an issue, but I don't know enough about msi internals to tell how correct it is. If you don't mind, please take a look :)
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51718 --- dlls/msi/dialog.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index a99a9076946..f56141a0c09 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -3886,6 +3886,10 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, EnableWindow(dialog->parent->hwnd, TRUE); SetForegroundWindow(dialog->parent->hwnd); } + if (gUIhwnd == hwnd) + { + gUIhwnd = NULL; + } dialog->hwnd = NULL; return 0; case WM_NOTIFY: @@ -3933,6 +3937,11 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) return ERROR_FUNCTION_FAILED; }
+ if (!dialog->parent && !gUIhwnd) + { + gUIhwnd = hwnd; + } + if (parent) { EnableWindow(parent, FALSE); -- 2.33.0