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 4539

Summary: SDL_QUIT is not reported when SDL_SYSWMEVENT has been enabled
Product: SDL Reporter: Adelaide Walter <adelaidekwalter>
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus, sezeroz
Version: 2.0.9Keywords: target-2.0.12
Hardware: x86_64   
OS: Windows 10   
Attachments: Simple test program.

Description Adelaide Walter 2019-03-06 21:41:49 UTC
On Windows 10 x64, enabling WM events via SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE) prevents SDL from ever reporting the SDL_QUIT event (e.g. by closing all windows).

I apologize for my difficulty in investigating and reporting this issue, as my project is .NET. I'll try my best to describe the issue through observation.

- When SDL_SYSWMEVENT is disabled, SDL reports SDL_QUIT as expected. When SDL_SYSWMEVENT is enabled, SDL never reports SDL_QUIT.
- Whether or not SDL_SYSWMEVENT is enabled, SDL reports SDL_WINDOWEVENT_CLOSE as expected. This is independent of the number of windows opened (single or multiple). This includes on close of the final window, when I expect SDL to also report SDL_QUIT.
- SDL never reports WM_QUIT.
- However, when SDL_SYSWMEVENT is enabled, SDL does report the other WM events I expect (e.g. WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE).
- All of the above behavior is independent of whether I handle events via poll or watch/filter.
Comment 1 Adelaide Walter 2019-03-06 21:46:41 UTC
Also:
- SDL_EventState(SDL_QUIT, SDL_QUERY) always returns true.
Comment 2 Ryan C. Gordon 2019-07-30 17:49:35 UTC
(Sorry if you get several emails like this, we're marking a bunch of bugs.)

We're hoping to ship SDL 2.0.11 on a much shorter timeframe than we have historically done releases, so I'm starting to tag bugs we hope to have closed in this release cycle.

Note that this tag means we just intend to scrutinize this bug for the 2.0.11 release: we may fix it, reject it, or even push it back to a later release for now, but this helps give us both a goal and a wishlist for the next release.

If this bug has been quiet for a few months and you have new information (such as, "this is definitely still broken" or "this got fixed at some point"), please feel free to retest and/or add more notes to the bug.

--ryan.
Comment 3 Ryan C. Gordon 2019-09-20 20:47:36 UTC
We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc).

As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change!

Thanks,
--ryan.
Comment 4 Ryan C. Gordon 2019-09-20 20:48:40 UTC
We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc).

As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change!

Thanks,
--ryan.
Comment 5 Ryan C. Gordon 2019-12-03 07:58:03 UTC
This works correctly on macOS, which I report simply to say that does not appear to be a bug in the higher level of SDL, but possibly something Windows-specific.

--ryan.
Comment 6 Ryan C. Gordon 2020-02-10 23:09:21 UTC
Created attachment 4200 [details]
Simple test program.


Here's a simple C program that just creates a window and blank renderer, and waits for an SDL_QUIT event with SDL_SYSWMEVENT enabled. On Windows 7, it's working correctly.

Testing Windows 10 next.

--ryan.
Comment 7 Ryan C. Gordon 2020-02-11 02:14:05 UTC
Tried this on Windows 10, still works.

It's possible the .NET integration has a bug, or the wrong value for SDL_QUIT or something, or maybe a thousand other things that could have gone wrong, but SDL itself appears to be doing the right thing here.

Please reopen this bug if you think I'm wrong on this one.

Thanks!

--ryan.