In other words the OnPaint exception caused a modal while another modal was showing.
not necessary "while modal was showing".
OnPaint exception is causing a default Exception handler to kick in.
LCL default Exception handler shows a modal dialog suggesting to continue or to terminate the application.
But modal dialogs should not be shown during Paint event at all (in Cocoa world).
It's either CocoaWS needs to suppress any exceptions occurred during Paint
OR there might be a way for Cocoa to "stop" painting in order to show the dialog
OR "showModal" method in CocoaWS needs to detect a paint event and silently do-nothing, if called during paint