Window refresh

Duane Clark dclark at akamail.com
Thu Mar 7 17:55:28 CST 2002


Xilinx fpga_editor in particular had major refresh problems, with things 
like scroll bars not being refreshed, windows not being refreshed until 
they were zoomed in, toolbars not being refreshed, excessive refreshing 
(isn't that ironic?) etc.

This patch completely fixes it, including eliminating the excessive 
refreshing. I have also tested it on a fairly wide variety of other 
programs, and see no introduced problems. So I think there is a 
reasonable chance it is the right thing.

The second hunk of the patch actually fixed most of the refresh 
problems, but also exposed a problem when the refresh area included the 
NC part of a window, but none of the client area. The first hunk of the 
patch fixes that problem.

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/07 22:53:10
@@ -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 );
 
@@ -166,10 +170,16 @@
 
     if (GetClassLongA( hwnd, GCL_STYLE ) & CS_PARENTDC)
     {
+        TRACE("Don't clip?\n");
         /* Don't clip the output to the update region for CS_PARENTDC window */
-        if (hrgnUpdate > 1) DeleteObject( hrgnUpdate );
+        /* This is not the correct (tested with fpga_editor). The first
+           problem with it is that if there are any child windows within the
+           window that are not part of the update region (for example scrollbars),
+           they get erased but not repainted. The second problem is that the
+           entire window is not repainted when run on WinNT and Win98. */
+/*        if (hrgnUpdate > 1) DeleteObject( hrgnUpdate );
         hrgnUpdate = 0;
-        dcx_flags &= ~DCX_INTERSECTRGN;
+        dcx_flags &= ~DCX_INTERSECTRGN;*/
     }
     else
     {


More information about the wine-patches mailing list