Commit 9da0c00a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Use top level window as dialog parent for modal dialogs.

parent 5e65b652
......@@ -587,24 +587,24 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if (modal && owner)
{
HWND parent;
disabled_owner = owner;
/*
* Owner needs to be top level window. We need to duplicate the logic from server,
* because we need to disable it before creating dialog window.
* because we need to disable it before creating dialog window. Note that we do that
* even if dialog has WS_CHILD, but only for modal dialogs, which matched what
* Windows does.
*/
while ((GetWindowLongW( disabled_owner, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) == WS_CHILD)
while ((GetWindowLongW( owner, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) == WS_CHILD)
{
parent = GetParent( disabled_owner );
parent = GetParent( owner );
if (!parent || parent == GetDesktopWindow()) break;
disabled_owner = parent;
owner = parent;
}
if (IsWindowEnabled( disabled_owner ))
if (IsWindowEnabled( owner ))
{
flags |= DF_OWNERENABLED;
disabled_owner = owner;
EnableWindow( disabled_owner, FALSE );
}
else
disabled_owner = NULL;
}
if (unicode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment