Both ShowMessage(AText); and MessageDlg(AText, mtInformation, [mbOK], 0); were not blocking the main thread. With LCLCocoa all dialogs created from Dialog unit are blocking the main thread. Is this a bug? Am I doing something wrong?Both ShowMessage (https://lazarus-ccr.sourceforge.io/docs/lcl/dialogs/showmessage.html) and MessageDlg (https://lazarus-ccr.sourceforge.io/docs/lcl/dialogs/messagedlg.html) are not blocking the main thread, they're calling modal dialogs.
Both ShowMessage(AText); and MessageDlg(AText, mtInformation, [mbOK], 0); were not blocking the main thread. With LCLCocoa all dialogs created from Dialog unit are blocking the main thread. Is this a bug? Am I doing something wrong?Both ShowMessage (https://lazarus-ccr.sourceforge.io/docs/lcl/dialogs/showmessage.html) and MessageDlg (https://lazarus-ccr.sourceforge.io/docs/lcl/dialogs/messagedlg.html) are not blocking the main thread, they're calling modal dialogs.
"Modal" means that the code, following the call to either function would only proceed after the dialog is closed (it's not "a thread blocking" in any manner).
If Carbon didn't show them in modal mode, then it's a LCLCarbon bug.
Your workaround is just fine.
just a thought: If the code is blocked behind the modal window, and the code is running on main thread 0, then from my code perspective the main thread 0 is blocked... What happens behind curtains is interesting but not relevant to the question above.Actually the only things "blocked" are input process (keyboard and the mouse...) and the execution of the code that follows ShowMessage();
If you want a modeless ShowMessage you'll have to build it yourself, I fear. It's not very difficult, though.
Whether the behaviour of ShowMessage in Carbon shold be considered a bug, a widgetset quirk or "how-it-should-be" is a question I'll leave to deeper minds than mine :)