Author: jimtabor
Date: Mon Jul 18 02:35:46 2016
New Revision: 71959
URL:
http://svn.reactos.org/svn/reactos?rev=71959&view=rev
Log:
[User32]
- Fix log out shutdown dialog window input. See CORE-11633 #resolve
Modified:
trunk/reactos/win32ss/user/user32/windows/dialog.c
Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] Mon Jul 18 02:35:46
2016
@@ -532,7 +532,7 @@
if (!(GetWindowLongPtrW( hwnd, GWL_STYLE ) & DS_NOIDLEMSG))
{
/* No message present -> send ENTERIDLE and wait */
- if (owner) SendMessageW( owner, WM_ENTERIDLE, MSGF_DIALOGBOX,
(LPARAM)hwnd );
+ SendMessageW( owner, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)hwnd );
}
GetMessageW( &msg, 0, 0, 0 );
}
@@ -919,25 +919,42 @@
if (modal_owner && owner)
{
- HWND parent;
+ HWND parent = NULL;
/*
* 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. Note that we do
that
* even if dialog has WS_CHILD, but only for modal dialogs, which matched what
* Windows does.
*/
- while ((GetWindowLongW( owner, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) ==
WS_CHILD)
- {
- parent = GetParent( owner );
- if (!parent || parent == GetDesktopWindow()) break;
- owner = parent;
+
+ ////// Wine'ie babies need to fix your code!!!! CORE-11633
+ if ((GetWindowLongW( owner, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) == WS_CHILD)
+ {
+ parent = owner;
+ while ((GetWindowLongW( parent, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) ==
WS_CHILD)
+ {
+ parent = GetParent( owner );
+ if (!parent || parent == GetDesktopWindow())
+ {
+ parent = NULL;
+ break;
+ }
+ }
+ }
+ else
+ parent = GetAncestor( owner, GA_ROOT );
+
+ if (parent)
+ {
+ owner = parent;
+
+ if (IsWindowEnabled( owner ))
+ {
+ disabled_owner = owner;
+ EnableWindow( disabled_owner, FALSE );
+ }
}
*modal_owner = owner;
- if (IsWindowEnabled( owner ))
- {
- disabled_owner = owner;
- EnableWindow( disabled_owner, FALSE );
- }
}
if (unicode)
@@ -1052,7 +1069,6 @@
}
return hwnd;
}
- //if (modal && ownerEnabled) DIALOG_EnableOwner(owner);
if (disabled_owner) EnableWindow( disabled_owner, TRUE );
IntNotifyWinEvent(EVENT_SYSTEM_DIALOGEND, hwnd, OBJID_WINDOW, CHILDID_SELF, 0);
if( IsWindow(hwnd) )
@@ -2036,6 +2052,7 @@
}
else
owner = GetWindow( hwnd, GW_OWNER );
+
if (owner)
EnableWindow( owner, TRUE );