Fix unexpected quit bug

This commit is contained in:
igor725 2024-03-11 17:47:17 +03:00
parent 4d671b4843
commit 361fce702e
No known key found for this signature in database
GPG Key ID: 46F13BBE46F8569D

View File

@ -664,9 +664,22 @@ std::thread VideoOut::createSDLThread() {
while (SDL_PollEvent(&event)) { while (SDL_PollEvent(&event)) {
switch (event.type) { switch (event.type) {
case SDL_WINDOWEVENT: case SDL_WINDOWEVENT:
case SDL_WINDOWEVENT_CLOSE: switch (event.window.event) {
case SDL_WINDOWEVENT_CLOSE:
cbWindow_close(window.window);
break;
default:
break;
}
case SDL_KEYUP:
if (event.key.keysym.scancode == SDL_SCANCODE_ESCAPE) {
cbWindow_close(window.window); cbWindow_close(window.window);
break; }
default:
break;
} }
} }
LOG_TRACE(L"<- flip(%d) set:%u buffer:%u", index, item.index, window.config.flipStatus.currentBuffer); LOG_TRACE(L"<- flip(%d) set:%u buffer:%u", index, item.index, window.config.flipStatus.currentBuffer);