Restore the pre-r17946 UserGetAncestor behaviour and fix the code calling it.

svn path=/trunk/; revision=17947
This commit is contained in:
Filip Navara 2005-09-20 10:45:27 +00:00
parent 27f30a175b
commit dff3a0dd3a
2 changed files with 9 additions and 4 deletions

View file

@ -520,7 +520,7 @@ HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
}
TopWnd = UserGetAncestor(Window, GA_ROOT);
if (TopWnd->hSelf != UserGetActiveWindow())
if (TopWnd && TopWnd->hSelf != UserGetActiveWindow())
{
// PWINDOW_OBJECT WndTops = UserGetWindowObject(hWndTop);
UserRefObjectCo(TopWnd);

View file

@ -1374,9 +1374,9 @@ co_IntCreateWindowEx(DWORD dwExStyle,
else
{
//temp hack
PWINDOW_OBJECT Par = UserGetWindowObject(hWndParent);
if (Par)
OwnerWindowHandle = UserGetAncestor(Par, GA_ROOT)->hSelf;
PWINDOW_OBJECT Par = UserGetWindowObject(hWndParent), Root;
if (Par && (Root = UserGetAncestor(Par, GA_ROOT)))
OwnerWindowHandle = Root->hSelf;
}
}
else if ((dwStyle & (WS_CHILD | WS_POPUP)) == WS_CHILD)
@ -2543,6 +2543,11 @@ PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type)
{
PWINDOW_OBJECT WndAncestor, Parent;
if (Wnd->hSelf == IntGetDesktopWindow())
{
return NULL;
}
switch (Type)
{
case GA_PARENT: