[client] app: add new app_handleCloseEvent for displayserver backends

This commit is contained in:
Geoffrey McRae 2021-01-17 13:36:37 +11:00
parent 89a6686349
commit 31c42e3676
2 changed files with 8 additions and 2 deletions

View file

@ -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);

View file

@ -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;