Validate parent after copying bits in child

svn path=/trunk/; revision=7287
This commit is contained in:
Gé van Geldorp 2003-12-28 10:56:20 +00:00
parent 0e37a36d20
commit b462f0f82b
3 changed files with 14 additions and 10 deletions

View file

@ -7,6 +7,8 @@
#include <include/msgqueue.h> #include <include/msgqueue.h>
#include <include/window.h> #include <include/window.h>
VOID FASTCALL
IntValidateParent(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.54 2003/12/27 15:09:51 navaraf Exp $ * $Id: painting.c,v 1.55 2003/12/28 10:56:20 gvg Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -59,7 +59,7 @@
/* PRIVATE FUNCTIONS **********************************************************/ /* PRIVATE FUNCTIONS **********************************************************/
VOID FASTCALL VOID FASTCALL
IntValidateParent(PWINDOW_OBJECT Child) IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion)
{ {
HWND Parent; HWND Parent;
PWINDOW_OBJECT ParentWindow; PWINDOW_OBJECT ParentWindow;
@ -80,11 +80,11 @@ IntValidateParent(PWINDOW_OBJECT Child)
*/ */
OffsetX = Child->WindowRect.left - ParentWindow->WindowRect.left; OffsetX = Child->WindowRect.left - ParentWindow->WindowRect.left;
OffsetY = Child->WindowRect.top - ParentWindow->WindowRect.top; OffsetY = Child->WindowRect.top - ParentWindow->WindowRect.top;
NtGdiOffsetRgn(Child->UpdateRegion, OffsetX, OffsetY ); NtGdiOffsetRgn(ValidRegion, OffsetX, OffsetY );
NtGdiCombineRgn(ParentWindow->UpdateRegion, ParentWindow->UpdateRegion, NtGdiCombineRgn(ParentWindow->UpdateRegion, ParentWindow->UpdateRegion,
Child->UpdateRegion, RGN_DIFF); ValidRegion, RGN_DIFF);
/* FIXME: If the resulting region is empty, remove fake posted paint message */ /* FIXME: If the resulting region is empty, remove fake posted paint message */
NtGdiOffsetRgn(Child->UpdateRegion, -OffsetX, -OffsetY); NtGdiOffsetRgn(ValidRegion, -OffsetX, -OffsetY);
} }
} }
IntReleaseWindowObject(ParentWindow); IntReleaseWindowObject(ParentWindow);
@ -361,7 +361,7 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags,
if (ValidateParent) if (ValidateParent)
{ {
IntValidateParent(Window); IntValidateParent(Window, Window->UpdateRegion);
} }
/* /*
@ -562,7 +562,7 @@ IntRedrawWindow(PWINDOW_OBJECT Window, const RECT* UpdateRect, HRGN UpdateRgn,
if (Window->UpdateRegion != NULL && Flags & RDW_ERASENOW) if (Window->UpdateRegion != NULL && Flags & RDW_ERASENOW)
{ {
/* Validate parent covered by region. */ /* Validate parent covered by region. */
IntValidateParent(Window); IntValidateParent(Window, Window->UpdateRegion);
} }
/* /*
@ -827,7 +827,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* lPs)
if (Window->UpdateRegion != NULL) if (Window->UpdateRegion != NULL)
{ {
MsqDecPaintCountQueue(Window->MessageQueue); MsqDecPaintCountQueue(Window->MessageQueue);
IntValidateParent(Window); IntValidateParent(Window, Window->UpdateRegion);
NtGdiDeleteObject(Window->UpdateRegion); NtGdiDeleteObject(Window->UpdateRegion);
Window->UpdateRegion = NULL; Window->UpdateRegion = NULL;
} }

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.75 2003/12/27 15:09:51 navaraf Exp $ /* $Id: winpos.c,v 1.76 2003/12/28 10:56:20 gvg Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -895,7 +895,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
* we don't have to crop (can't take anything away from an empty * we don't have to crop (can't take anything away from an empty
* region...) * region...)
*/ */
if (!(WinPos.flags & (SWP_NOSIZE | SWP_NOZORDER)) && RgnType != ERROR && if (!(WinPos.flags & SWP_NOSIZE) && RgnType != ERROR &&
RgnType != NULLREGION) RgnType != NULLREGION)
{ {
RECT ORect = OldClientRect; RECT ORect = OldClientRect;
@ -940,6 +940,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
* to create a copy of CopyRgn and pass that. We need CopyRgn later * to create a copy of CopyRgn and pass that. We need CopyRgn later
*/ */
HRGN ClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0); HRGN ClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(ClipRgn, CopyRgn, NULL, RGN_COPY); NtGdiCombineRgn(ClipRgn, CopyRgn, NULL, RGN_COPY);
Dc = NtUserGetDCEx(Wnd, ClipRgn, DCX_WINDOW | DCX_CACHE | Dc = NtUserGetDCEx(Wnd, ClipRgn, DCX_WINDOW | DCX_CACHE |
DCX_INTERSECTRGN | DCX_CLIPSIBLINGS); DCX_INTERSECTRGN | DCX_CLIPSIBLINGS);
@ -949,6 +950,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
CopyRect.left + (OldWindowRect.left - NewWindowRect.left), CopyRect.left + (OldWindowRect.left - NewWindowRect.left),
CopyRect.top + (OldWindowRect.top - NewWindowRect.top), SRCCOPY); CopyRect.top + (OldWindowRect.top - NewWindowRect.top), SRCCOPY);
NtUserReleaseDC(Wnd, Dc); NtUserReleaseDC(Wnd, Dc);
IntValidateParent(Window, CopyRgn);
} }
} }
else else