From adf709aee18892095de09a355d72ef08436c3c94 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 12 Feb 2015 23:10:10 +0000 Subject: [PATCH] [NtUser] - Fix dialog breakage due to r66237. svn path=/trunk/; revision=66239 --- reactos/win32ss/user/ntuser/window.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 66e858f4b26..a0f5240f497 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -379,17 +379,29 @@ static void IntSendDestroyMsg(HWND hWnd) * be destroying. */ // Rule #1 - if ( ti->MessageQueue->spwndActive == Window || + if ( ti->MessageQueue->spwndActive == Window || // Fixes CORE-106 RegSrv32 exit and return focus to CMD. (ti->MessageQueue->spwndActive == NULL && ti->MessageQueue == IntGetFocusMessageQueue()) ) { co_WinPosActivateOtherWindow(Window); } + /* Fixes dialog test test_focus breakage due to r66237 and CMD properties closing and returning focus to CMD */ + if (ti->MessageQueue->spwndFocus == Window) + { + if ((Window->style & (WS_CHILD | WS_POPUP)) == WS_CHILD) + { + co_UserSetFocus(Window->spwndParent); + } + else + { + co_UserSetFocus(NULL); + } + } + if (ti->MessageQueue->CaretInfo->hWnd == UserHMGetHandle(Window)) { co_IntDestroyCaret(ti); } - } /* @@ -2566,10 +2578,12 @@ BOOLEAN co_UserDestroyWindow(PVOID Object) co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (WPARAM) hWnd, 0); } + /* Hide the window */ if (Window->style & WS_VISIBLE) { if (Window->style & WS_CHILD) { + /* Only child windows receive WM_SHOWWINDOW in DestroyWindow() */ co_WinPosShowWindow(Window, SW_HIDE); } else @@ -3846,7 +3860,6 @@ CLEANUP: END_CLEANUP; } - /* * @implemented */ @@ -3885,7 +3898,6 @@ CLEANUP: END_CLEANUP; } - /* * @implemented */