Run the entire Cocoa messagebox function on the main thread.

This fixes bug https://github.com/libsdl-org/SDL/issues/4420
This commit is contained in:
Sam Lantinga
2021-07-27 14:57:18 -07:00
parent dfd3f30e88
commit 51c61d7cdf
2 changed files with 19 additions and 10 deletions

View File

@@ -197,7 +197,7 @@ main(int argc, char *argv[])
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Simple MessageBox",
"This is a simple error MessageBox with a parent window",
"This is a simple error MessageBox with a parent window. Press a key or close the window after dismissing this messagebox.",
window);
if (success == -1) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());