Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51576 Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/msi/dialog.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 703f9d43957..e6048ee6a22 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -140,6 +140,9 @@ typedef struct static DWORD uiThreadId; static HWND hMsiHiddenWindow;
+static HWND handle_parent_dialog[10] = { NULL }; +static UINT parent_level = 0; + static LPWSTR msi_get_window_text( HWND hwnd ) { UINT sz, r; @@ -3881,6 +3884,11 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, return SendMessageW( (HWND) lParam, WM_CTLCOLORSTATIC, wParam, lParam );
case WM_DESTROY: + if (parent_level > 0) + { + handle_parent_dialog[parent_level - 1] = NULL; + parent_level--; + } dialog->hwnd = NULL; return 0; case WM_NOTIFY: @@ -3904,7 +3912,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,15 +3925,23 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize)) style |= WS_MINIMIZEBOX;
+ parent = parent_level > 0 ? handle_parent_dialog[parent_level - 1] : 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 )); return ERROR_FUNCTION_FAILED; }
+ if (parent_level < ARRAY_SIZE(handle_parent_dialog)) + { + handle_parent_dialog[parent_level] = hwnd; + parent_level++; + } + ShowWindow( hwnd, SW_SHOW ); /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */
-- 2.33.0
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51717 Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/msi/dialog.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index e6048ee6a22..3ef626a1dfa 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -3884,6 +3884,10 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, return SendMessageW( (HWND) lParam, WM_CTLCOLORSTATIC, wParam, lParam );
case WM_DESTROY: + if (parent_level > 1) + { + EnableWindow(handle_parent_dialog[parent_level - 2], TRUE); + } if (parent_level > 0) { handle_parent_dialog[parent_level - 1] = NULL; @@ -3942,6 +3946,11 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) parent_level++; }
+ if (parent) + { + EnableWindow(parent, FALSE); + } + ShowWindow( hwnd, SW_SHOW ); /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */
-- 2.33.0
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 3ef626a1dfa..bd4a95f4262 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -3893,6 +3893,10 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, handle_parent_dialog[parent_level - 1] = NULL; parent_level--; } + if (gUIhwnd == hwnd) + { + gUIhwnd = NULL; + } dialog->hwnd = NULL; return 0; case WM_NOTIFY: @@ -3940,6 +3944,11 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) return ERROR_FUNCTION_FAILED; }
+ if (parent_level == 0 && !gUIhwnd) + { + gUIhwnd = hwnd; + } + if (parent_level < ARRAY_SIZE(handle_parent_dialog)) { handle_parent_dialog[parent_level] = hwnd; -- 2.33.0
On 9/3/21 9:33 PM, Fabian Maurer wrote:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51576 Signed-off-by: Fabian Maurer dark.shadow4@web.de
dlls/msi/dialog.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 703f9d43957..e6048ee6a22 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -140,6 +140,9 @@ typedef struct static DWORD uiThreadId; static HWND hMsiHiddenWindow;
+static HWND handle_parent_dialog[10] = { NULL }; +static UINT parent_level = 0;
I'm curious, how does this work wrt threading? Why 10? This looks more like a workaround to me.
static LPWSTR msi_get_window_text( HWND hwnd ) { UINT sz, r; @@ -3881,6 +3884,11 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, return SendMessageW( (HWND) lParam, WM_CTLCOLORSTATIC, wParam, lParam );
case WM_DESTROY:
if (parent_level > 0)
{
handle_parent_dialog[parent_level - 1] = NULL;
parent_level--;
case WM_NOTIFY:} dialog->hwnd = NULL; return 0;
@@ -3904,7 +3912,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,15 +3925,23 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize)) style |= WS_MINIMIZEBOX;
- parent = parent_level > 0 ? handle_parent_dialog[parent_level - 1] : 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 )); return ERROR_FUNCTION_FAILED; }
if (parent_level < ARRAY_SIZE(handle_parent_dialog))
{
handle_parent_dialog[parent_level] = hwnd;
parent_level++;
}
ShowWindow( hwnd, SW_SHOW ); /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */
-- 2.33.0
On Freitag, 3. September 2021 21:03:10 CEST Nikolay Sivov wrote:
On 9/3/21 9:33 PM, Fabian Maurer wrote:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51576 Signed-off-by: Fabian Maurer dark.shadow4@web.de
dlls/msi/dialog.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 703f9d43957..e6048ee6a22 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -140,6 +140,9 @@ typedef struct
static DWORD uiThreadId; static HWND hMsiHiddenWindow;
+static HWND handle_parent_dialog[10] = { NULL }; +static UINT parent_level = 0;
I'm curious, how does this work wrt threading? Why 10? This looks more like a workaround to me.
The ten is an arbitrary limit, that basically no one should reach. Just to avoid dynamic re/allocations, do you dislike this approach?
Not sure what threading you mean, can msi have multithreaded windows? I thought not...
Regards, Fabian Maurer
On Fri, 2021-09-03 at 21:19 +0200, Fabian Maurer wrote:
On Freitag, 3. September 2021 21:03:10 CEST Nikolay Sivov wrote:
On 9/3/21 9:33 PM, Fabian Maurer wrote:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51576 Signed-off-by: Fabian Maurer dark.shadow4@web.de
dlls/msi/dialog.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 703f9d43957..e6048ee6a22 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -140,6 +140,9 @@ typedef struct
static DWORD uiThreadId; static HWND hMsiHiddenWindow;
+static HWND handle_parent_dialog[10] = { NULL }; +static UINT parent_level = 0;
I'm curious, how does this work wrt threading? Why 10? This looks more like a workaround to me.
The ten is an arbitrary limit, that basically no one should reach. Just to avoid dynamic re/allocations, do you dislike this approach?
We should pass the parent dialog hwnd to CreateWindow instead of tracking that seperately in a global variable.
On Montag, 6. September 2021 10:06:34 CEST you wrote:
On Fri, 2021-09-03 at 21:19 +0200, Fabian Maurer wrote:
On Freitag, 3. September 2021 21:03:10 CEST Nikolay Sivov wrote:
On 9/3/21 9:33 PM, Fabian Maurer wrote:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51576 Signed-off-by: Fabian Maurer dark.shadow4@web.de
dlls/msi/dialog.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 703f9d43957..e6048ee6a22 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -140,6 +140,9 @@ typedef struct
static DWORD uiThreadId; static HWND hMsiHiddenWindow;
+static HWND handle_parent_dialog[10] = { NULL }; +static UINT parent_level = 0;
I'm curious, how does this work wrt threading? Why 10? This looks more like a workaround to me.
The ten is an arbitrary limit, that basically no one should reach. Just to avoid dynamic re/allocations, do you dislike this approach?
We should pass the parent dialog hwnd to CreateWindow instead of tracking that seperately in a global variable.
Sorry, I don't think I understand. Isn't the whole reason we track it that we can pass it later to CreateWindow?
Regards, Fabian Maurer
On Mon, 2021-09-06 at 19:38 +0200, Fabian Maurer wrote:
We should pass the parent dialog hwnd to CreateWindow instead of tracking that seperately in a global variable.
Sorry, I don't think I understand. Isn't the whole reason we track it that we can pass it later to CreateWindow?
We already have it in dialog->parent->hwnd.