This is needed to be able to lock the application fully on OS X, where the global menu bar would still allow interaction even when a modal dialog is displayed.