Window refresh, take 4

Duane Clark dclark at akamail.com
Fri Mar 8 21:41:54 CST 2002


The previous version was not in fact the correct fix for the window 
refresh. Having BeginPaint return zero when when the clip region is 
empty was the wrong thing to do. This one seems to behave much better. 
It still completely fixes refreshing of fpga_editor, including the 
situation where the update region includes the NC area but not the 
client area, without breaking any of my other apps.

Log message:
	Do not erase the entire window on CS_PARENTDC.

-------------- 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/09 02:45:20
@@ -164,24 +169,14 @@
     dcx_flags = DCX_INTERSECTRGN | DCX_WINDOWPAINT | DCX_USESTYLE;
     if (bIcon) dcx_flags |= DCX_WINDOW;
 
-    if (GetClassLongA( hwnd, GCL_STYLE ) & CS_PARENTDC)
+    if (!hrgnUpdate)  /* empty region, clip everything */
     {
-        /* Don't clip the output to the update region for CS_PARENTDC window */
-        if (hrgnUpdate > 1) DeleteObject( hrgnUpdate );
-        hrgnUpdate = 0;
-        dcx_flags &= ~DCX_INTERSECTRGN;
+        hrgnUpdate = CreateRectRgn( 0, 0, 0, 0 );
     }
-    else
+    else if (hrgnUpdate == 1)  /* whole client area, don't clip */
     {
-        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;
-        }
+        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