From 2ce933f05b4f7db445c313abd4a6659698f43305 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Tue, 26 Jul 2005 16:34:48 +0000 Subject: [PATCH] Fix reverting of focus to owner windows. svn path=/trunk/; revision=16749 --- reactos/subsys/win32k/ntuser/winpos.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/reactos/subsys/win32k/ntuser/winpos.c b/reactos/subsys/win32k/ntuser/winpos.c index 4e4831f1eed..5f0363d34b3 100644 --- a/reactos/subsys/win32k/ntuser/winpos.c +++ b/reactos/subsys/win32k/ntuser/winpos.c @@ -114,6 +114,29 @@ WinPosActivateOtherWindow(PWINDOW_OBJECT Window) IntSetFocusMessageQueue(NULL); return; } + if ((Window->Style & WS_POPUP) && (Wnd = IntGetOwner(Window))) + { + for(;;) + { + Old = Wnd; + Wnd = IntGetParentObject(Wnd); + if(IntIsDesktopWindow(Wnd)) + { + IntReleaseWindowObject(Wnd); + Wnd = Old; + break; + } + IntReleaseWindowObject(Old); + } + + if (IntSetForegroundWindow(Wnd)) + { + IntReleaseWindowObject(Wnd); + return; + } + + IntReleaseWindowObject(Wnd); + } Wnd = Window; for(;;) {