- Bug fixes.

- NtUserDestroyWindow should destroy owned popup windows (Fixes some problems with Explorer menus).
- Changed WinPosSetWindowPos to take coordinates relative to parent, because it is used as such everywhere.

svn path=/trunk/; revision=7734
This commit is contained in:
Filip Navara 2004-01-18 08:29:31 +00:00
parent faaee8fe61
commit bffadccb2c
4 changed files with 14 additions and 46 deletions

View file

@ -9,6 +9,8 @@
VOID FASTCALL VOID FASTCALL
IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion); IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion);
VOID FASTCALL
IntValidateSiblings(PWINDOW_OBJECT Child, HRGN ValidRegion);
BOOL FASTCALL BOOL FASTCALL
IntRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags); IntRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags);
BOOL FASTCALL BOOL FASTCALL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: painting.c,v 1.62 2004/01/17 15:18:25 navaraf Exp $ * $Id: painting.c,v 1.63 2004/01/18 08:29:31 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -270,8 +270,7 @@ IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
*/ */
VOID FASTCALL VOID FASTCALL
IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
BOOL ValidateParent)
{ {
INT RgnType; INT RgnType;
BOOL HadPaintMessage, HadNCPaintMessage; BOOL HadPaintMessage, HadNCPaintMessage;
@ -364,15 +363,6 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags,
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT; Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
} }
/*
* Validate parent covered by region
*/
if (ValidateParent)
{
IntValidateParent(Window, Window->UpdateRegion);
}
/* /*
* Split the nonclient update region. * Split the nonclient update region.
*/ */
@ -418,7 +408,7 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags,
NtGdiOffsetRgn(hRgnTemp, NtGdiOffsetRgn(hRgnTemp,
Window->WindowRect.left - Child->WindowRect.left, Window->WindowRect.left - Child->WindowRect.left,
Window->WindowRect.top - Child->WindowRect.top); Window->WindowRect.top - Child->WindowRect.top);
IntInvalidateWindows(Child, hRgnTemp, Flags, FALSE); IntInvalidateWindows(Child, hRgnTemp, Flags);
NtGdiDeleteObject(hRgnTemp); NtGdiDeleteObject(hRgnTemp);
} }
IntReleaseWindowObject(Child); IntReleaseWindowObject(Child);
@ -546,13 +536,7 @@ IntRedrawWindow(PWINDOW_OBJECT Window, const RECT* UpdateRect, HRGN UpdateRgn,
if (Flags & (RDW_INVALIDATE | RDW_VALIDATE | RDW_INTERNALPAINT | RDW_NOINTERNALPAINT)) if (Flags & (RDW_INVALIDATE | RDW_VALIDATE | RDW_INTERNALPAINT | RDW_NOINTERNALPAINT))
{ {
IntInvalidateWindows(Window, hRgn, Flags, TRUE); IntInvalidateWindows(Window, hRgn, Flags);
} else
if (Window->UpdateRegion != NULL && (Flags & (RDW_ERASENOW | RDW_UPDATENOW)))
{
/* Validate parent covered by region. */
IntValidateParent(Window, Window->UpdateRegion);
IntValidateParent(Window, Window->NCUpdateRegion);
} }
/* /*

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: window.c,v 1.176 2004/01/17 15:18:25 navaraf Exp $ /* $Id: window.c,v 1.177 2004/01/18 08:29:31 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -1555,7 +1555,6 @@ NtUserDestroyWindow(HWND Wnd)
} }
/* Recursively destroy owned windows */ /* Recursively destroy owned windows */
#if 0 /* FIXME */
if (! isChild) if (! isChild)
{ {
for (;;) for (;;)
@ -1573,6 +1572,10 @@ NtUserDestroyWindow(HWND Wnd)
for (ChildHandle = Children; *ChildHandle; ++ChildHandle) for (ChildHandle = Children; *ChildHandle; ++ChildHandle)
{ {
Child = IntGetWindowObject(*ChildHandle); Child = IntGetWindowObject(*ChildHandle);
if (Child == NULL)
{
continue;
}
if (Child->Owner != Window) if (Child->Owner != Window)
{ {
continue; continue;
@ -1599,7 +1602,6 @@ NtUserDestroyWindow(HWND Wnd)
} }
} }
} }
#endif
if (!IntIsWindow(Wnd)) if (!IntIsWindow(Wnd))
{ {
@ -3112,23 +3114,6 @@ NtUserSetWindowPos(
int cy, int cy,
UINT uFlags) UINT uFlags)
{ {
PWINDOW_OBJECT WindowObject;
WindowObject = IntGetWindowObject(hWnd);
if (WindowObject == NULL)
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return FALSE;
}
if (WindowObject->Style & WS_CHILD)
{
X += WindowObject->Parent->ClientRect.left;
Y += WindowObject->Parent->ClientRect.top;
}
IntReleaseWindowObject(WindowObject);
return WinPosSetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags); return WinPosSetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags);
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: winpos.c,v 1.81 2004/01/17 15:18:25 navaraf Exp $ /* $Id: winpos.c,v 1.82 2004/01/18 08:29:31 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -268,6 +268,8 @@ WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos)
{ {
WinPosGetMinMaxInfo(WindowObject, &Size, &InternalPos->MaxPos, WinPosGetMinMaxInfo(WindowObject, &Size, &InternalPos->MaxPos,
NULL, NULL); NULL, NULL);
DPRINT1("Maximize: %d,%d %dx%d\n",
InternalPos->MaxPos.x, InternalPos->MaxPos.y, Size.x, Size.y);
if (WindowObject->Style & WS_MINIMIZE) if (WindowObject->Style & WS_MINIMIZE)
{ {
WindowObject->Style &= ~WS_MINIMIZE; WindowObject->Style &= ~WS_MINIMIZE;
@ -757,11 +759,6 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
WinPos.cx = cx; WinPos.cx = cx;
WinPos.cy = cy; WinPos.cy = cy;
WinPos.flags = flags; WinPos.flags = flags;
if (Window->Style & WS_CHILD)
{
WinPos.x -= Window->Parent->ClientRect.left;
WinPos.y -= Window->Parent->ClientRect.top;
}
WinPosDoWinPosChanging(Window, &WinPos, &NewWindowRect, &NewClientRect); WinPosDoWinPosChanging(Window, &WinPos, &NewWindowRect, &NewClientRect);