I need to send messages to the GUI thread which should be processed the next time the GUI thread is idle. This message can come from the GUI thread or background threads.
I tried a combination of a MachPort/Notification. But when i do a
[[NSNotificationQueue defaultQueue] enqueueNotification: my_notify postingStyle: NSPostASAP];
This is not dispatched if there is a modal dialog, i have to close the dialog before it is processed so this is not useable for me.
It's okay to not handle messages during menu selection or live resize, but modal dialogs is a little bit too much delay.