From 73e0bb651e929c5ec3a080b74ff3ca9db4076851 Mon Sep 17 00:00:00 2001 From: Dmytro Kyshchenko Date: Wed, 28 Jan 2026 16:40:01 +0200 Subject: [PATCH] Fix #20356 - Flatpak application doesn't close until controller is unplugged. When the controller is connected SLD sends a lot of events (`SDL_JOYAXISMOTION` and etc.), so PPSSPP is stuck in the loop to process these events. Fixed by duplicating the `if` statement to check whether the quit was requested inside the loop. --- SDL/SDLMain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 599080cac1..ed43e56c62 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -1797,8 +1797,12 @@ int main(int argc, char *argv[]) { while (true) { SDL_Event event; while (SDL_WaitEventTimeout(&event, 100)) { + if (g_QuitRequested || g_RestartRequested) + break; + ProcessSDLEvent(window, event, &inputTracker); } + if (g_QuitRequested || g_RestartRequested) break;