On Thu, 25 Sep 2003, Alexandre Julliard wrote:
Pavel Roskin proski@gnu.org writes:
OK, drop that part of the patch for now. I think that xoring anything with COLOR_WINDOWTEXT is incorrect, but I need to test possible other solutions.
After all, the bug is about the white mess from dragging windows, which is a bigger problem.
Well, yes, but it's a bug in XFree86, not in Wine.
Confirmed. Accelerated X works correctly with the same hardware and X libraries, while XFree86 4.2.1 exhibits the bug.
Nevertheless, I checked how the focus rectangle works on Windows 2000 and found something we may want to fix.
Actually, there are two focus rectangles. The one displayed on buttons with keyboard focus is drawn by opaque pen in xor mode using alternating button face and button text colors. This guarantees that the focus is visible if the text on buttons is visible. Usually it's not different from the other focus rectangle. But if the button text is white on lightgray, the focus rectangle is almost a continuous line. If the button text is blue on lightgray, the focus rectangle is drawn by yellow and black dots.
The other focus rectangle is displayed by calling DrawFocusRectangle(). In this case, the line is transparent and uses simple inversion. No color scheme settings affect the color.
I'm attaching a patch that fixes DrawFocusRectangle() to use inversion. I also removed reference to COLOR_WINDOWTEXT to aesthetic reasons. The pen color is unused, but nobody should think that any color schemes affect this function.
This change is also sufficient to work around the XFree86 bug. We don't have to work it around, but we are lucky that it's a side effect of making DrawFocusRect() correct.
I also included a patch that removes special treatment for R2_XORPEN with black pen. I don't see such behavior in Windows 2000. I also tested Paintbrush from Windows 3.11 and it has no graphical problems except Pick->Tilt, which is unaffected by this code. It's an old hack that is wrong and unneeded now.