[Bug 28678] DirectDraw primary buffer is obscured by transparent window

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Oct 12 12:46:31 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=28678

--- Comment #5 from Octavian Voicu <octavian.voicu at gmail.com> 2011-10-12 12:46:31 CDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > Haven't tested that, I'm going to try to write a small app to test this. I
> > don't really understand how it actually happens that the rectangle is obscured
> > though. Is it based on Z-ordering of windows and ddraw->wined3d_frontbuffer has
> > an attached Z-buffer?
> > 
> We don't do anything special about this in ddraw/wined3d. From your description
> it sounds like the gray rectangle you're seeing is the dialog painting its
> background while it shouldn't (because of WS_EX_TRANSPARENT).

I think WS_EX_TRANSPARENT says nothing about default handling of WM_ERASEBKGND
in DefDlgProc. I checked using Spy++ and also on native, even with
WS_EX_TRANSPARENT set, dialog paints its background using a solid brush.

Sequence of messages is (M - main window, D - dialog/child window):
D: WM_NCPAINT
D: WM_ERASEBKGND -> returns fErased: True
M: WM_NCPAINT
M: WM_ERASEBKGND -> returns fErased: False
M: WM_PAINT
D: WM_PAINT
D: WM_PAINT
D: WM_PAINT
...

Even if the dialog paints its background, I'm guessing its WM_PAINT handler
renders the window to the front buffer, and that it should be able to draw over
WS_EX_TRANSPARENT windows. Removing the WS_EX_TRANSPARENT style makes the main
window not receive the WM_PAINT message after WM_ERASEBKGND.

The weird thing is that if I hack wine and change the DefDlgProc code to not
erase the background on WM_ERASEBKGND, then I won't see anything at all! Then I
hacked IDirectDraw::Blt function to offset all destination rects 10 pixels up
and right, and after this I see 10x10 of the window. So it is obvious that
whatever happens inside wined3d, it is somehow masking the area occupied by the
dialog window.

Doing a WINEDDBLT_COLORFILL on the front buffer is the only thing that can draw
over the window (a simple blit is still masked by it).

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list