I'm developing an application running in all platforms (Windows, Linux and Macintosh).

In the Mac version of my application I'm having a serious problem with modal dialogs.

Here's the problem:

I have two widgets say, W1 and W2. W2 is a child of W1.
I create then 2 modal dialogs at the same time, the first one with parent W1, say D1, and the second one with parent W2 say D2.
D2 is shown before D1. When D1 is shown it appears behind D2 but it has the focus. There is no way to press "Ok" on D1 and the application is completely blocked (there is nothing the user can do to unblock it).

This is not happening in the Windows and Linux version of my application. The modal Dialog that has the focus always appears on top of all other dialogs so the user can interact with it.

Does anyone has encountered the same problem? Is there a solution to it?

Thanks in advantage for the help.