Fix for bug 640 - moving thin frames leaves mess

Pavel Roskin proski at
Mon Sep 29 16:50:40 CDT 2003

On Sun, 28 Sep 2003, Alexandre Julliard wrote:

> Pavel Roskin <proski at> writes:
> > Patch for cmdlgtst.c to produce those pictures is attached.  before.png
> > was taken with current Wine.  after.png is with the fix that removes the
> > special procession of R2_XORPEN.  I would not say that nobody will use
> > this effect.  Anyway, the whole thing is not worth arguing about.
> I think it's definitely worth arguing about, and you are right that
> there are cases where the hack is wrong, I missed the opaque
> background issue. Still, the hack was added for a reason, so I don't
> think we want to remove it completely; but it should be improved to
> check for the pen and background types.

Too bad I cannot reproduce any problem with Paintbrush.  I even put FIXME
to the code but it's never activated if DrawFocusRect() is fixed (see

I have no idea what "rubber-drawings" mean.  I have tried all tools in 8
and 24 bpp and the problems I see are not affected by the code in
question.  The problems are:

Paintbrush won't exit without saving.

Flood fill takes a wrong point as reference and paints with the same
incorrect offset.  The horizontal offset (63) is almost equal to the width
of the toolbox (64).  The vertical offset is 3 pixels high.

One-color eraser (left, third from top) is a terrible CPU hog.

Selection lines are not redrawn after being covered by the menu.  After
the selection is canceled, the obscured part becomes visible and remains
in the picture.

Saving images crashes with:
Unhandled exception: unimplemented function olesvr.dll.OLERENAMESERVERDOC
called in 32-bit code (0x413b6250).

Pavel Roskin
-------------- next part --------------
--- graphics/x11drv/graphics.c
+++ graphics/x11drv/graphics.c
@@ -212,8 +212,11 @@ BOOL X11DRV_SetupGCForPen( X11DRV_PDEVIC
 	/* It is very unlikely someone wants to XOR with 0 */
 	/* This fixes the rubber-drawings in paintbrush */
 	if (val.foreground == 0)
+        {
+            FIXME("Attempt to XOR with 0, working around\n");
             val.foreground = (WhitePixel( gdi_display, DefaultScreen(gdi_display) ) ^
                               BlackPixel( gdi_display, DefaultScreen(gdi_display) ));
+        }
 	val.function = GXxor;
     default :
--- windows/painting.c
+++ windows/painting.c
@@ -1158,7 +1158,7 @@ BOOL WINAPI DrawFocusRect( HDC hdc, cons
     INT oldDrawMode, oldBkMode;
     hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH));
-    hNewPen = CreatePen(PS_ALTERNATE, 1, GetSysColor(COLOR_WINDOWTEXT));
+    hNewPen = CreatePen(PS_ALTERNATE, 1, RGB(255, 255, 255));
     hOldPen = SelectObject(hdc, hNewPen);
     oldDrawMode = SetROP2(hdc, R2_XORPEN);
     oldBkMode = SetBkMode(hdc, TRANSPARENT);

More information about the wine-devel mailing list