From 2f7e31bc07dff109a54567286b3f39045a88fb76 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 29 Nov 2013 03:43:41 +0000 Subject: [PATCH] [Win32k] - Fix CORE-1161 and CORE-6651. - Minor fixups. svn path=/trunk/; revision=61142 --- reactos/win32ss/user/ntuser/desktop.c | 12 ++++++++++-- reactos/win32ss/user/ntuser/focus.c | 27 ++++++++++++++++++++++++++- reactos/win32ss/user/ntuser/winpos.c | 2 +- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/reactos/win32ss/user/ntuser/desktop.c b/reactos/win32ss/user/ntuser/desktop.c index 1f018405a4a..3a1bc9bea47 100644 --- a/reactos/win32ss/user/ntuser/desktop.c +++ b/reactos/win32ss/user/ntuser/desktop.c @@ -518,8 +518,16 @@ IntSetFocusMessageQueue(PUSER_MESSAGE_QUEUE NewQueue) gpqForegroundPrev = Old; } // Only one Q can have active foreground even when there are more than one desktop. - if (NewQueue) gpqForeground = pdo->ActiveMessageQueue; - else gpqForeground = NULL; + if (NewQueue) + { + gpqForeground = pdo->ActiveMessageQueue; + } + else + { + gpqForeground = NULL; + ERR("ptiLastInput is CLEARED!!\n"); + ptiLastInput = NULL; // ReactOS hacks,,,, should check for process death. + } } PWND FASTCALL diff --git a/reactos/win32ss/user/ntuser/focus.c b/reactos/win32ss/user/ntuser/focus.c index cf79511c2d9..ebcd629ee51 100644 --- a/reactos/win32ss/user/ntuser/focus.c +++ b/reactos/win32ss/user/ntuser/focus.c @@ -138,6 +138,31 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO } } //// + //// CORE-1161 and CORE-6651 + if (Window->spwndPrev) + { + HWND *phwndTopLevel, *phwndCurrent; + PWND pwndCurrent, pwndDesktop; + + pwndDesktop = UserGetDesktopWindow(); + if (Window->spwndParent == pwndDesktop ) + { + phwndTopLevel = IntWinListChildren(pwndDesktop); + phwndCurrent = phwndTopLevel; + while(*phwndCurrent) + { + pwndCurrent = UserGetWindowObject(*phwndCurrent); + + if (pwndCurrent && pwndCurrent->spwndOwner == Window ) + { + co_WinPosSetWindowPos(pwndCurrent, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE); + } + phwndCurrent++; + } + ExFreePool(phwndTopLevel); + } + } + //// OldTID = WindowPrev ? IntGetWndThreadId(WindowPrev) : NULL; NewTID = IntGetWndThreadId(Window); ptiOld = WindowPrev ? WindowPrev->head.pti : NULL; @@ -184,7 +209,7 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO } } } - ExFreePool(List);//ExFreePoolWithTag(List, USERTAG_WINDOWLIST); + ExFreePoolWithTag(List, USERTAG_WINDOWLIST); } } if (WindowPrev) diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index bc4cc6598ce..1b630e12893 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -359,7 +359,7 @@ done: //ERR("WinPosActivateOtherWindow Set Active 0x%p\n",WndTo); if (!co_IntSetActiveWindow(WndTo,FALSE,TRUE,FALSE)) /* Ok for WndTo to be NULL here */ { - co_IntSetActiveWindow(0,FALSE,TRUE,FALSE); + co_IntSetActiveWindow(NULL,FALSE,TRUE,FALSE); } if (WndTo) UserDerefObjectCo(WndTo); }