From 31c42e3676ab581f29dff7ef7aa56d518558daec Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 17 Jan 2021 13:36:37 +1100 Subject: [PATCH] [client] app: add new app_handleCloseEvent for displayserver backends --- client/include/app.h | 1 + client/src/main.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/include/app.h b/client/include/app.h index 4c19fa51..55415921 100644 --- a/client/include/app.h +++ b/client/include/app.h @@ -38,6 +38,7 @@ void app_handleMouseBasic(void); void app_handleWindowEnter(void); void app_handleWindowLeave(void); void app_handleFocusEvent(bool focused); +void app_handleCloseEvent(void); void app_clipboardRelease(void); void app_clipboardNotify(const LG_ClipboardData type, size_t size); diff --git a/client/src/main.c b/client/src/main.c index 6e33a922..26973634 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -151,6 +151,12 @@ void app_handleFocusEvent(bool focused) g_state.ds->realignPointer(); } +void app_handleCloseEvent(void) +{ + if (!params.ignoreQuit || !g_cursor.inView) + g_state.state = APP_STATE_SHUTDOWN; +} + static void alignToGuest(void) { if (SDL_HasEvent(e_SDLEvent)) @@ -1372,8 +1378,7 @@ int eventFilter(void * userdata, SDL_Event * event) break; case SDL_WINDOWEVENT_CLOSE: - if (!params.ignoreQuit || !g_cursor.inView) - g_state.state = APP_STATE_SHUTDOWN; + app_handleCloseEvent(); break; } return 0;