- Fixed more bugs reported by Wine user32 window test. (7/373 tests fails now)
authorFilip Navara <filip.navara@gmail.com>
Wed, 29 Oct 2003 10:04:55 +0000 (10:04 +0000)
committerFilip Navara <filip.navara@gmail.com>
Wed, 29 Oct 2003 10:04:55 +0000 (10:04 +0000)
svn path=/trunk/; revision=6456

reactos/subsys/win32k/ntuser/window.c
reactos/subsys/win32k/ntuser/winpos.c

index 1b9cbfe..0898edd 100644 (file)
@@ -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: window.c,v 1.124 2003/10/29 08:49:56 navaraf Exp $
+/* $Id: window.c,v 1.125 2003/10/29 10:04:55 navaraf Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -353,6 +353,7 @@ IntCreateDesktopWindow(PWINSTATION_OBJECT WindowStation,
   WindowObject->Height = Height;
   WindowObject->ParentHandle = NULL;
   WindowObject->Parent = NULL;
+  WindowObject->hWndOwner = NULL;
   WindowObject->IDMenu = 0;
   WindowObject->Instance = NULL;
   WindowObject->Parameters = NULL;
@@ -658,6 +659,7 @@ IntLinkWindow(
   )
 {
   Wnd->Parent = WndParent; 
+  Wnd->ParentHandle = WndParent->Self; 
 
   if ((Wnd->PrevSibling = WndPrevSibling))
   {
@@ -2256,10 +2258,7 @@ NtUserGetWindow(HWND hWnd, UINT Relationship)
       }
       break;
     case GW_OWNER:
-      if (Wnd->Parent)
-      {
-        hWndResult = Wnd->hWndOwner;
-      }
+      hWndResult = Wnd->hWndOwner;
       break;
     case GW_CHILD:
       if (Wnd->FirstChild)
@@ -2350,11 +2349,13 @@ NtUserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi)
        case GWL_HWNDPARENT:
          if (WindowObject->ParentHandle == IntGetDesktopWindow())
          {
-               Result = (LONG) WindowObject->hWndOwner;
+               Result = (LONG) NtUserGetWindow(WindowObject->Self, GW_OWNER);
+               /*WindowObject->hWndOwner*/
          }
          else
          {
-               Result = (LONG) WindowObject->ParentHandle;
+               Result = (LONG) NtUserGetAncestor(WindowObject->Self, GA_PARENT);
+               /*WindowObject->ParentHandle*/
          }
          break;
 
index a1fb46c..f909061 100644 (file)
@@ -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.38 2003/10/28 13:43:56 navaraf Exp $
+/* $Id: winpos.c,v 1.39 2003/10/29 10:04:55 navaraf Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -563,6 +563,17 @@ WinPosDoWinPosChanging(PWINDOW_OBJECT WindowObject,
   return TRUE;
 }
 
+/*
+ * Fix Z order taking into account owned popups -
+ * basically we need to maintain them above the window that owns them
+ */
+HWND FASTCALL
+WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
+{
+   /* FIXME */
+   return hWndInsertAfter;
+}
+
 /***********************************************************************
  *          WinPosInternalMoveWindow
  *
@@ -721,8 +732,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
       NtUserGetAncestor(WinPos.hwnd, GA_PARENT) ==
       PsGetWin32Thread()->Desktop->DesktopWindow)
     {
-/* FIXME */
-/*      WinPos.hwndInsertAfter = WinPosDoOwnedPopups(WinPos.hwnd, WinPos.hwndInsertAfter);*/
+      WinPos.hwndInsertAfter = WinPosDoOwnedPopups(WinPos.hwnd, WinPos.hwndInsertAfter);
     }
   
   /* FIXME: Adjust flags based on WndInsertAfter */