We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3650

Summary: [Patch] Add support for parented message boxes on Windows so that they retain exclusive focus at all times!
Product: SDL Reporter: Ismael Ferreras Morezuelas (Swyter) <swyterzone+sdl>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus, swyterzone+sdl
Version: HG 2.0   
Hardware: All   
OS: Windows (All)   
Attachments: The patch itself, pretty tiny!

Description Ismael Ferreras Morezuelas (Swyter) 2017-05-13 00:50:07 UTC
Created attachment 2733 [details]
The patch itself, pretty tiny!

Hi there! I have been meaning to fix this one for a while.

The fact that at the moment clicking a crashed window hides the messagebox with all the handy information it has to offer about the cause of the problem has probably caused additional rage for more than one, I bet.

This three-line patch finds if the current messagebox has an assigned parent window and if that's the case grabs its window handle and uses it on dialog creation. Windows will then give exclusive focus to that new dialog whenever someone clicks over the crashed window in despair. So that we can at least fail with style.


Windows-only at the moment, even if I believe that the Linux version has similar problems. Maybe I can get around and fix that one after getting this patch through.

Let me know what you think! I can rework it a bit more, as I don't want to ship a forked version!


PS: SDL2 is pretty neat and straightforward to use. Thanks so much! :)
Comment 1 Ryan C. Gordon 2017-05-27 04:33:36 UTC
This patch is now https://hg.libsdl.org/SDL/rev/c5346d5c3c79, thanks!

--ryan.