0

There is an interesting behaviour of DirectX where it differs between the Windows implementation (DirectX 11) and the Wine implementation under Linux.

In order to determine whether it is a bug in the Wine implementation or the program, I’d like to know where exactly this behaviour is documented, as I have not been able to find anything except "It works for Windows".

Here’s the description: When drawing on a window using DirectX, it seems that any visible child window of this window is not painted over. As an example, here is the MeshViewer from the DirectX SDK’s samples:

http://imageshack.us/photo/my-images/264/unbenannt2nf3.jpg/

(The main window’s handle is passed as the hDeviceWindow in the present parameters in CreateDevice.) The tool bar and status bar are visible in Windows, but under Wine they are obscured by the DirectX surface:

https://i.stack.imgur.com/lF4pK.png

I have also observed this behaviour in another application with a tool bar that creates a DirectX surface the size of the window’s client area and relies on DirectX to figure out which areas to paint over. Interestingly enough, the tool bar seems to be not painted over the DirectX surface every frame (I’ve set a breakpoint in the tool bar’s Paint handler), so my guess is that DirectX somehow figures out the position of the child windows and does not paint over them in the first place.

Is that correct and if yes, where is it documented?

  • 1
    Did you try playing around with the WS_CLIPCHILDREN and WS_CLICPSIBLINGS window styles? Also try to see if the height of client area of the window includes the toolbar and the status bar and maybe try making that equal to the area you actually want drawing to happen. – Barış Uşaklı Apr 16 '12 at 14:18
  • Thanks Baris, that did the trick. I did not realize it wasn’t specific to DirectX, so I looked in the wrong places … BTW it is indeed a Wine bug, WS_CLIPCHILDREN is not respected in DirectX/OpenGL. [Here is the bug report in question](http://bugs.winehq.org/show_bug.cgi?id=15232). Thanks again! – user1083696 Apr 18 '12 at 21:12

0 Answers0