diff --git a/reactos/subsys/win32k/include/painting.h b/reactos/subsys/win32k/include/painting.h index 59ba11799aa..72a75641a3f 100644 --- a/reactos/subsys/win32k/include/painting.h +++ b/reactos/subsys/win32k/include/painting.h @@ -7,6 +7,8 @@ #include #include +VOID FASTCALL +IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion); BOOL FASTCALL IntRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags); BOOL FASTCALL diff --git a/reactos/subsys/win32k/ntuser/painting.c b/reactos/subsys/win32k/ntuser/painting.c index 27088bf5e3d..25b4cdc6a52 100644 --- a/reactos/subsys/win32k/ntuser/painting.c +++ b/reactos/subsys/win32k/ntuser/painting.c @@ -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: 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 * PROJECT: ReactOS kernel @@ -59,7 +59,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ VOID FASTCALL -IntValidateParent(PWINDOW_OBJECT Child) +IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion) { HWND Parent; PWINDOW_OBJECT ParentWindow; @@ -80,11 +80,11 @@ IntValidateParent(PWINDOW_OBJECT Child) */ OffsetX = Child->WindowRect.left - ParentWindow->WindowRect.left; OffsetY = Child->WindowRect.top - ParentWindow->WindowRect.top; - NtGdiOffsetRgn(Child->UpdateRegion, OffsetX, OffsetY ); + NtGdiOffsetRgn(ValidRegion, OffsetX, OffsetY ); NtGdiCombineRgn(ParentWindow->UpdateRegion, ParentWindow->UpdateRegion, - Child->UpdateRegion, RGN_DIFF); + ValidRegion, RGN_DIFF); /* FIXME: If the resulting region is empty, remove fake posted paint message */ - NtGdiOffsetRgn(Child->UpdateRegion, -OffsetX, -OffsetY); + NtGdiOffsetRgn(ValidRegion, -OffsetX, -OffsetY); } } IntReleaseWindowObject(ParentWindow); @@ -361,7 +361,7 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, 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) { /* Validate parent covered by region. */ - IntValidateParent(Window); + IntValidateParent(Window, Window->UpdateRegion); } /* @@ -827,7 +827,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* lPs) if (Window->UpdateRegion != NULL) { MsqDecPaintCountQueue(Window->MessageQueue); - IntValidateParent(Window); + IntValidateParent(Window, Window->UpdateRegion); NtGdiDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; } diff --git a/reactos/subsys/win32k/ntuser/winpos.c b/reactos/subsys/win32k/ntuser/winpos.c index 4a40b1b1f7d..42105ee895b 100644 --- a/reactos/subsys/win32k/ntuser/winpos.c +++ b/reactos/subsys/win32k/ntuser/winpos.c @@ -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.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 * 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 * region...) */ - if (!(WinPos.flags & (SWP_NOSIZE | SWP_NOZORDER)) && RgnType != ERROR && + if (!(WinPos.flags & SWP_NOSIZE) && RgnType != ERROR && RgnType != NULLREGION) { 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 */ HRGN ClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0); + NtGdiCombineRgn(ClipRgn, CopyRgn, NULL, RGN_COPY); Dc = NtUserGetDCEx(Wnd, ClipRgn, DCX_WINDOW | DCX_CACHE | 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.top + (OldWindowRect.top - NewWindowRect.top), SRCCOPY); NtUserReleaseDC(Wnd, Dc); + IntValidateParent(Window, CopyRgn); } } else