From 361fce702e03d402b6f1b264fc48699f051639e1 Mon Sep 17 00:00:00 2001 From: igor725 Date: Mon, 11 Mar 2024 17:47:17 +0300 Subject: [PATCH] Fix unexpected quit bug --- core/videoout/videoout.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/core/videoout/videoout.cpp b/core/videoout/videoout.cpp index c8e29d8..a84b8a8 100644 --- a/core/videoout/videoout.cpp +++ b/core/videoout/videoout.cpp @@ -664,9 +664,22 @@ std::thread VideoOut::createSDLThread() { while (SDL_PollEvent(&event)) { switch (event.type) { 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); - break; + } + + default: + break; } } LOG_TRACE(L"<- flip(%d) set:%u buffer:%u", index, item.index, window.config.flipStatus.currentBuffer);