System colors

Kevin Koltzau kevin at
Mon Nov 22 22:12:24 CST 2004

CreateBrushIndirect under Wine currently returns stock brushes if the brush requested
matches the color. In gdi/brush.c the following comment is made:
/* If a solid brush is created in a color matching one of the 
 * stock brushes, native returns the stock object (GDI heap 
 * optimisation). Some apps rely on this as they otherwise
 * would leak their brushes.

However under both Windows 95 and Windows XP this does not seem to be the case.
Under Windows, the following holds true, but fails under Wine
GetStockObject(BLACK_BRUSH) != CreateSolidBrush(RGB(0,0,0))

This issue currently breaks applications making calls to SetSysColors as stock brushes
are deleted as the new colors are added.

Does anyone know why this was setup in this way? Or which version of Windows that 
exhibits the behavior mentioned in the comment?


More information about the wine-devel mailing list