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 - SDL_QUIT Event - Windows
Summary: SDL_QUIT Event - Windows
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.0
Hardware: x86 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 21:46 UTC by Daniel
Modified: 2013-05-21 02:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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