Window refresh, take 3

Duane Clark dclark at akamail.com
Fri Mar 8 13:42:06 CST 2002


Oops, guess I need to attach it.

Log message:
	Do not erase the entire window on CS_PARENTDC.
	If update region includes the NC area but not the client area,
	don't erase the client area.

-------------- next part --------------
Index: dlls/user/painting.c
===================================================================
RCS file: /home/wine/wine/dlls/user/painting.c,v
retrieving revision 1.1
diff -u -r1.1 painting.c
--- dlls/user/painting.c	2001/12/13 01:03:30	1.1
+++ dlls/user/painting.c	2002/03/08 18:20:26
@@ -155,7 +155,11 @@
 
     /* send WM_NCPAINT and retrieve update region */
     hrgnUpdate = begin_ncpaint( hwnd );
-    if (!hrgnUpdate && !IsWindow( hwnd )) return 0;
+    
+    /* When the update region includes only the NC area, it has already
+       been painted, and we should return NULL to not bother painting 
+       the client area. */
+    if (!hrgnUpdate) return 0;
 
     HideCaret( hwnd );
 
@@ -164,24 +168,10 @@
     dcx_flags = DCX_INTERSECTRGN | DCX_WINDOWPAINT | DCX_USESTYLE;
     if (bIcon) dcx_flags |= DCX_WINDOW;
 
-    if (GetClassLongA( hwnd, GCL_STYLE ) & CS_PARENTDC)
+    if (hrgnUpdate == 1)  /* whole client area, don't clip */
     {
-        /* Don't clip the output to the update region for CS_PARENTDC window */
-        if (hrgnUpdate > 1) DeleteObject( hrgnUpdate );
         hrgnUpdate = 0;
         dcx_flags &= ~DCX_INTERSECTRGN;
-    }
-    else
-    {
-        if (!hrgnUpdate)  /* empty region, clip everything */
-        {
-            hrgnUpdate = CreateRectRgn( 0, 0, 0, 0 );
-        }
-        else if (hrgnUpdate == 1)  /* whole client area, don't clip */
-        {
-            hrgnUpdate = 0;
-            dcx_flags &= ~DCX_INTERSECTRGN;
-        }
     }
     lps->hdc = GetDCEx( hwnd, hrgnUpdate, dcx_flags );
     /* ReleaseDC() in EndPaint() will delete the region */


More information about the wine-patches mailing list