I'm a Windows developer developing a Cocoa-based plugin for a MacOS host application (Premiere Pro). At certain times, the host blockingly calls into my plugin callback function, at which time I'm supposed to show a modal dialog, only returning once the dialog is dismissed.
I've already managed to put up the modal dialog, nicely parenting it to the host's main window via:
// Get this from the host
NSWindow* parentWindowHandle = ...;
// Create this one myself, or rather have the Juce framework create it for me
NSWindow* ourWindowHandle = ...;
// Connect the two
[parentWindowHandle addChildWindow:ourWindowHandle ordered:NSWindowAbove];
This works nicely; my dialog is always on top of the host, and the host's main window is disabled.
But...
The host's menu is still active at that time. And worse, it is even responsive as well, which allows the user to start host functionality while my modal dialog is up, which ultimately results in their modal open next to mine and a certain hang (forever spinning beachball).
I realize it's quite possible I'm attacking this the wrong way being a Windows developer and all, but then again maybe this is just an oversight in the host app?
And an almost certainly related question which might be a clue as well: Copy/Paste via the keyboard just doesn't work in text boxes in my plugin modal dialogs, right until I manually click the host's "Edit" menu open, after which keyboard shortcut pasting works again. For the rest of the host's lifetime no less, even when my dialog gets dismissed and a new one created later on.
EDIT
I've tried [[NSApplication sharedApplication] runModalForWindow: myDialogWindow]
as advertized in the linked question, but it blocks right on that line. Seems legit, since it should enter a modal loop. However, my Cocoa window is created for me by a GUI framework (Juce; it's a multiplatform project), so I have no control over how the messages for the window are handled. So I guess the above way is unusable in my situation?