Index: ntuser/painting.c =================================================================== --- ntuser/painting.c (revision 19665) +++ ntuser/painting.c (working copy) @@ -81,11 +81,14 @@ return TRUE; } -VOID FASTCALL -IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion) +BOOL FASTCALL +IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion, BOOL Recurse) { PWINDOW_OBJECT ParentWindow = Child->Parent; + while (ParentWindow && ParentWindow->Style & WS_CHILD) + ParentWindow = ParentWindow->Parent; + while (ParentWindow) { if (ParentWindow->Style & WS_CLIPCHILDREN) @@ -93,13 +96,17 @@ if (ParentWindow->UpdateRegion != 0) { - NtGdiCombineRgn(ParentWindow->UpdateRegion, ParentWindow->UpdateRegion, - ValidRegion, RGN_DIFF); - /* FIXME: If the resulting region is empty, remove fake posted paint message */ + if (Recurse) + return FALSE; + + IntInvalidateWindows(ParentWindow, Child->UpdateRegion, + RDW_VALIDATE | RDW_NOCHILDREN); } ParentWindow = ParentWindow->Parent; } + + return TRUE; } /** @@ -219,7 +226,7 @@ */ STATIC VOID FASTCALL -co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags) +co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse) { HDC hDC; HWND hWnd = Window->hSelf; @@ -229,7 +236,8 @@ { if (Window->UpdateRegion) { - IntValidateParent(Window, Window->UpdateRegion); + if (!IntValidateParent(Window, Window->UpdateRegion, Recurse)) + return; } if (Flags & RDW_UPDATENOW) @@ -290,6 +298,7 @@ if ((List = IntWinListChildren(Window))) { + /* FIXME: Handle WS_EX_TRANSPARENT */ for (phWnd = List; *phWnd; ++phWnd) { Window = UserGetWindowObject(*phWnd); @@ -297,7 +306,7 @@ { USER_REFERENCE_ENTRY Ref; UserRefObjectCo(Window, &Ref); - co_IntPaintWindows(Window, Flags); + co_IntPaintWindows(Window, Flags, TRUE); UserDerefObjectCo(Window); } } @@ -565,7 +574,7 @@ if (Flags & (RDW_ERASENOW | RDW_UPDATENOW)) { - co_IntPaintWindows(Window, Flags); + co_IntPaintWindows(Window, Flags, FALSE); } /* Index: ntuser/winpos.c =================================================================== --- ntuser/winpos.c (revision 19665) +++ ntuser/winpos.c (working copy) @@ -1194,7 +1194,6 @@ CopyRect.left + (OldWindowRect.left - NewWindowRect.left), CopyRect.top + (OldWindowRect.top - NewWindowRect.top), SRCCOPY); UserReleaseDC(Window, Dc, FALSE); - IntValidateParent(Window, CopyRgn); NtGdiOffsetRgn(CopyRgn, -NewWindowRect.left, -NewWindowRect.top); } else if(VisRgn) Index: include/painting.h =================================================================== --- include/painting.h (revision 19665) +++ include/painting.h (working copy) @@ -5,10 +5,10 @@ #include #include -VOID FASTCALL -IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion); BOOL FASTCALL co_UserRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags); +VOID FASTCALL +IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags); BOOL FASTCALL IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, PW32THREAD Thread, MSG *Message, BOOL Remove);