From ef4ad83edffd967e6bb0b92ef3add492851df35b Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 30 Nov 2003 22:48:11 +0000 Subject: [PATCH] Attempt to fix WinPosActivateOtherWindow problem reported by GvG. svn path=/trunk/; revision=6837 --- reactos/subsys/win32k/include/focus.h | 2 ++ reactos/subsys/win32k/ntuser/focus.c | 15 ++++----------- reactos/subsys/win32k/ntuser/winpos.c | 6 +++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/reactos/subsys/win32k/include/focus.h b/reactos/subsys/win32k/include/focus.h index a28aca3dac2..d1776820cc1 100644 --- a/reactos/subsys/win32k/include/focus.h +++ b/reactos/subsys/win32k/include/focus.h @@ -17,5 +17,7 @@ IntGetThreadFocusWindow(); BOOL FASTCALL IntSetForegroundWindow(PWINDOW_OBJECT Window); +HWND FASTCALL +IntSetActiveWindow(PWINDOW_OBJECT Window); #endif /* _WIN32K_FOCUS_H */ diff --git a/reactos/subsys/win32k/ntuser/focus.c b/reactos/subsys/win32k/ntuser/focus.c index eaea6b9031b..04224cefe95 100644 --- a/reactos/subsys/win32k/ntuser/focus.c +++ b/reactos/subsys/win32k/ntuser/focus.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: focus.c,v 1.1 2003/11/30 20:29:09 navaraf Exp $ + * $Id: focus.c,v 1.2 2003/11/30 22:48:11 navaraf Exp $ */ #include @@ -171,10 +171,10 @@ IntSetActiveWindow(PWINDOW_OBJECT Window) if (Window != 0) { - if (Window->MessageQueue != ThreadQueue) + if (!(Window->Style & WS_VISIBLE) || + (Window->Style & (WS_POPUP | WS_CHILD)) == WS_CHILD) { - IntReleaseWindowObject(Window); - return 0; + return ThreadQueue ? 0 : ThreadQueue->ActiveWindow; } hWnd = Window->Self; } @@ -264,13 +264,6 @@ NtUserSetActiveWindow(HWND hWnd) ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue; - if (!(Window->Style & WS_VISIBLE) || - (Window->Style & (WS_POPUP | WS_CHILD)) == WS_CHILD) - { - IntReleaseWindowObject(Window); - return ThreadQueue ? 0 : ThreadQueue->ActiveWindow; - } - if (Window->MessageQueue != ThreadQueue) { IntReleaseWindowObject(Window); diff --git a/reactos/subsys/win32k/ntuser/winpos.c b/reactos/subsys/win32k/ntuser/winpos.c index 4943c120a7d..f4ea9b698d2 100644 --- a/reactos/subsys/win32k/ntuser/winpos.c +++ b/reactos/subsys/win32k/ntuser/winpos.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: winpos.c,v 1.48 2003/11/30 20:03:47 navaraf Exp $ +/* $Id: winpos.c,v 1.49 2003/11/30 22:48:11 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -166,9 +166,9 @@ done: IntReleaseWindowObject(Window); } - if (! NtUserSetActiveWindow(hwndTo)) + if (!IntSetActiveWindow(hwndTo)) { - NtUserSetActiveWindow(NULL); + IntSetActiveWindow(NULL); } }