From c9f41ea69e25b3172191b3a50cb5676fed246ae6 Mon Sep 17 00:00:00 2001 From: Quantum Date: Tue, 5 Jan 2021 01:38:36 -0500 Subject: [PATCH] [client] fix ignoreQuit on Wayland On Wayland, SDL_WINDOWEVENT_CLOSE is sent even when exiting with keyboard shortcuts. This meant that the client is still closed even with -Q. We now swallow SDL_WINDOWEVENT_CLOSE if the cursor is inside the VM. This should prevent keyboard shortcuts from closing the client, while still allowing the window to be closed by clicking X with the mouse per #138. --- client/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index 144152f9..1aa33290 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1272,9 +1272,9 @@ int eventFilter(void * userdata, SDL_Event * event) } break; - // allow a window close event to close the application even if ignoreQuit is set case SDL_WINDOWEVENT_CLOSE: - g_state.state = APP_STATE_SHUTDOWN; + if (!params.ignoreQuit || !g_cursor.inView) + g_state.state = APP_STATE_SHUTDOWN; break; } return 0;