Toolbar background error

Alexandre Julliard julliard at winehq.com
Fri Aug 17 20:54:52 CDT 2001


Marcus Meissner <marcus at jet.franken.de> writes:

> I suggest reading the Corel CVS for this part of the code.
> 
> They rewrote this part like _5_ times.

But their solution is still not correct IMO. How about something like
this?

Index: windows/defwnd.c
===================================================================
RCS file: /opt/cvs-commit/wine/windows/defwnd.c,v
retrieving revision 1.59
diff -u -r1.59 defwnd.c
--- windows/defwnd.c	2001/08/10 22:51:43	1.59
+++ windows/defwnd.c	2001/08/18 00:21:43
@@ -461,10 +461,13 @@
             HBRUSH hbr = GetClassLongW( wndPtr->hwndSelf, GCL_HBRBACKGROUND );
             if (!hbr) return 0;
 
-            /* GetClientRect used to be GetClipBox, but it is not what
-             * Windows does, and it breaks badly with CS_PARENTDC */
-            GetClientRect( wndPtr->hwndSelf, &rect );
-            DPtoLP( hdc, (LPPOINT)&rect, 2 );
+            if (GetClassLongW( wndPtr->hwndSelf, GCL_STYLE ) & CS_PARENTDC)
+            {
+                /* can't use GetClipBox with a parent DC or we fill the whole parent */
+                GetClientRect( wndPtr->hwndSelf, &rect );
+                DPtoLP( hdc, (LPPOINT)&rect, 2 );
+            }
+            else GetClipBox( hdc, &rect );
             FillRect( hdc, &rect, hbr );
 	    return 1;
 	}


-- 
Alexandre Julliard
julliard at winehq.com




More information about the wine-devel mailing list