Validate parent after copying bits in child
authorGé van Geldorp <ge@gse.nl>
Sun, 28 Dec 2003 10:56:20 +0000 (10:56 +0000)
committerGé van Geldorp <ge@gse.nl>
Sun, 28 Dec 2003 10:56:20 +0000 (10:56 +0000)
svn path=/trunk/; revision=7287

reactos/subsys/win32k/include/painting.h
reactos/subsys/win32k/ntuser/painting.c
reactos/subsys/win32k/ntuser/winpos.c

index 59ba117..72a7564 100644 (file)
@@ -7,6 +7,8 @@
 #include <include/msgqueue.h>
 #include <include/window.h>
 
+VOID FASTCALL
+IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion);
 BOOL FASTCALL
 IntRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags);
 BOOL FASTCALL
index 27088bf..25b4cdc 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: 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;
    }
index 4a40b1b..42105ee 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.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