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 1144

Summary: SDL_QUIT Event - Windows
Product: SDL Reporter: Daniel <daniel350>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.0   
Hardware: x86   
OS: Windows 7   

Description Daniel 2011-02-22 21:46:33 UTC
The SDL_QUIT event is never received, ie you cannot close a window by its X button in the top right hand corner.
The window itself can be closed if you handle the event on another input, such as the 'Q' key.

For example:

while (SDL_PollEvent(&event)) {
	switch (event.type) {
		case SDL_QUIT: device.closeDevice(); break;
	}
}

Assuming device has a 'closeDevice' method, which closes the SDL window; this code should close the window upon the SDL_QUIT event, it does not, and is never handled by the switch (ie SDL_QUIT event is never sent).
Comment 1 Sam Lantinga 2011-02-22 22:00:04 UTC
Have you tried this with the latest SDL snapshot?  This should already be fixed:
http://www.libsdl.org/tmp/SDL-1.3.zip