From c8fd4da71c654fa28771b6c97f59a6615831ede4 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 25 May 2012 19:52:24 +0000 Subject: [PATCH] [Win32k] - Fix the remaining wine Win test_SetFocus to does. svn path=/trunk/; revision=56658 --- reactos/win32ss/user/ntuser/winpos.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index ab4eb258c11..c76636a1e2c 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -1711,7 +1711,7 @@ co_WinPosSetWindowPos( } } - if (!(WinPos.flags & SWP_NOACTIVATE))//(SWP_NOACTIVATE|SWP_HIDEWINDOW))) + if (!(WinPos.flags & (SWP_NOACTIVATE|SWP_HIDEWINDOW))) { if ((Window->style & (WS_CHILD | WS_POPUP)) == WS_CHILD) { @@ -1848,6 +1848,15 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd) Swp |= SWP_NOACTIVATE; if (!(style & WS_MINIMIZE)) { + // Fix wine Win test_SetFocus todo #1 & #2, + if (Cmd == SW_SHOWMINIMIZED) + { + if ((style & (WS_CHILD | WS_POPUP)) == WS_CHILD) + co_UserSetFocus(Wnd->spwndParent); + else + co_UserSetFocus(0); + } + Swp |= co_WinPosMinMaximize(Wnd, SW_MINIMIZE, &NewPos) | SWP_FRAMECHANGED; } @@ -1965,7 +1974,7 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd) { Parent = Wnd->spwndParent; if (Wnd->spwndParent == UserGetDesktopWindow()) Parent = 0; - co_UserSetFocus(Parent); + co_UserSetFocus(Parent); } } @@ -1978,8 +1987,12 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd) } /* if previous state was minimized Windows sets focus to the window */ - if (style & WS_MINIMIZE) co_UserSetFocus(Wnd); - + if (style & WS_MINIMIZE) + { + co_UserSetFocus(Wnd); + // Fix wine Win test_SetFocus todo #3, + if (!(style & WS_CHILD)) co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_ACTIVATE, WA_ACTIVE, 0); + } return(WasVisible); } -- 2.17.1