Make window.close cancelable (resolve #817)

This commit is contained in:
Joshua Granick
2017-01-11 15:23:50 -08:00
parent 0f41f2555b
commit 21c52bb29f
4 changed files with 36 additions and 14 deletions

View File

@@ -265,6 +265,19 @@ namespace lime {
case SDL_WINDOWEVENT_CLOSE:
ProcessWindowEvent (event);
// Avoid handling SDL_QUIT if in response to window.close
SDL_Event event;
if (SDL_PollEvent (&event)) {
if (event.type != SDL_QUIT) {
HandleEvent (&event);
}
}
break;
}