Limit invalidate region if required
Modified: trunk/reactos/subsys/win32k/ntuser/painting.c

Modified: trunk/reactos/subsys/win32k/ntuser/painting.c
--- trunk/reactos/subsys/win32k/ntuser/painting.c	2005-12-04 22:30:27 UTC (rev 19893)
+++ trunk/reactos/subsys/win32k/ntuser/painting.c	2005-12-04 22:31:43 UTC (rev 19894)
@@ -320,6 +320,19 @@
    BOOL HasPaintMessage, HasNCPaintMessage;
 
    /*
+    * If the nonclient is not to be redrawn, clip the region to the client
+    * rect
+    */
+   if (0 != (Flags & RDW_INVALIDATE) && 0 == (Flags & RDW_FRAME))
+   {
+      HRGN hRgnClient;
+
+      hRgnClient = UnsafeIntCreateRectRgnIndirect(&Window->ClientRect);
+      RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND);
+      NtGdiDeleteObject(hRgnClient);
+   }
+
+   /*
     * Clip the given region with window rectangle (or region)
     */