SDL_ShowMessageBox and SDL_ShowSimpleMessageBox Deadlocks The Parent Window

Confirmed behavior on Windows10, SDL version 2.0.10

Should the MessageBox or SimpleMessageBox be given a parent window, and that parent window loses focus, they deadlock with the parent window because they can no longer regain focus. Should they be visible, trying to click on any of the buttons or the message box itself only focuses on the parent window, sending the message box behind it.

A workaround to this is to spawn the message box without a parent window (by passing NULL to either of the box’s SDL_Window member), which will then have the message box spawn as its own window and thus show up on the Alt-Tab list, and ultimately able to gain focus. This isn’t a great workaround because sometimes the message box will be sent behind the parent or other windows, but its better than a deadlock at least.

I suppose the fix within the SDL lib itself would have the parent window check its child windows if they want the focus, and likewise put the child window in focus and on top of the render stack.