PATCH: wrong clipRect when CS_PARENTDC and WS_CLIPSIBLINGS styles are combined

lsla at post.cz lsla at post.cz
Fri Jul 27 08:50:57 CDT 2001


Hello

I tried to run some Progress database apps with Wine. The controls (radio buttons) in a form were not drawn correctly in the 16 bit Windows version of the Progress RDBMS (_prowin.exe v 7).  I spent several weeks staring at the relay trace until I found that the problem is caused by a combination of CS_PARENTDC and WS_CLIPSIBLINGS styles.

The _prowin form serves as a parent window for several radio buttons which are of class CS_PARENTDC and have WS_CLIPSIBLINGS in their style. The children erase their background themselves by responding to WM_ERASEBKGND. The WM_ERASEBKGND handler calls GetClipRect and then FillRect to do that.

Where the Wine's GetClipRect returns the area of the parent, the Windows version returns only the area of the child. Therefore in Wine the WM_ERASEBKGND message erases the whole parent including the other radio buttons.

After I applied enclosed patch, the _prowin.exe  started to work perfectly. As I am not fully oriented in the Wine DCE  magic, I am not
sure if this is the right way to repair the bug. Please be patient with me, I am new to Wine.

Regards 


Ladislav Sladecek
-------------- next part --------------
? lo
Index: windows/painting.c
===================================================================
RCS file: /home/wine/wine/windows/painting.c,v
retrieving revision 1.50
diff -u -u -r1.50 painting.c
--- windows/painting.c	2001/07/25 00:43:36	1.50
+++ windows/painting.c	2001/07/27 12:45:55
@@ -351,9 +351,11 @@
 
     TRACE("hrgnUpdate = %04x, \n", hrgnUpdate);
 
-    if (GetClassLongA(wndPtr->hwndSelf, GCL_STYLE) & CS_PARENTDC)
+    if ((GetClassLongA(wndPtr->hwndSelf, GCL_STYLE) & CS_PARENTDC) &&
+        !(wndPtr->dwStyle & WS_CLIPSIBLINGS))
     {
-        /* Don't clip the output to the update region for CS_PARENTDC window */
+        /* Don't clip the output to the update region for CS_PARENTDC window 
+         unless the window has the WS_CLIPSIBLINGS style.*/
 	if( hrgnUpdate ) 
 	    DeleteObject(hrgnUpdate);
         lps->hdc = GetDCEx( hwnd, 0, DCX_WINDOWPAINT | DCX_USESTYLE |


More information about the wine-patches mailing list