Bringing my applications from Windows to Mac OS X, I noticed that AlertWindow::runModalLoop() does not block neither the global menubar (which Windows does not have) nor the close button of the main window (as instead it does on Windows). Therefore it becomes possible to close the application or use commands that are not pertinent when one would expect a blocking modal dialog.
For example, if you click the close button of the main window while you are responding to the AlertWindow asking to save changes to the current document, you open a new alert (but not if you use the native alerts).
The cleanest way to do it would be to create an RAII class that disables the menus while it’s alive, and just declare one on the stack before you run your modal loop.
This is also problematic if you try to resize a window when another window is modal. You get the OSX alert sound continuously when you’re dragging the resizer, which is pretty annoying. Seems like there should be a better way to handle this than having to manually disable resizing (and menus, etc.) whenever a modal dialog is opened.
I tried this on version 2.0, though not the repo head, but unless you’ve done work on it since the stable release, I’m guessing the problem still exists.
Follow these steps:
load the demo app
enable native title bar
choose Widgets demo
click for a popup menu
choose a Juce file chooser dialog
While the file chooser is open, you can still close, minimize, maximize, and resize the main window underneath. It’s the resizing in particular that generates an unending stream of alert sounds.
Note that, with a native file chooser, none of these problems happen.